response.redirect and user controls

Neil Fennessey asked on June 27, 2014 15:04

We have used response.redirects extensively throughout our custom application which is built in user controls housed within Kentico. I'm thinking that we could remove the hard-coded page names in our r.r's and instead reference the individual page nodeids within kentico. Is our logic sound? The problem we have is that we frequently change the names of files which breaks the response.redirects. If we were to instead reference the nodeid or the documentid, any time we changed a page name or moved its location, we'd be okay since we'd have the native page's location stored in the kentico cms tables. Is this a correct assumption and if so, is there any architectural documentation on how we could do this? Thank you in advance.

Recent Answers

Joshua Adams answered on June 27, 2014 15:49

You could add properties onto the usercontrols/webparts and have a url selector or path selector for the form control. This would allow you to change them easily through the kentico interface. Is that an option for you or are these controls not inheriting from cmsabstractwebpart?

0 votesVote for this answer Mark as a Correct answer

Yehuda Lando answered on June 28, 2014 15:07

Another option is to get the node by it's nodeid and then redirect to its NodeAliasPath

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 30, 2014 07:15

I'm assuming you're using ASPX model for your site, is that correct? Are you using URL aliases? If so, then this shouldn't be a problem for documents/pages.

I'd agree 100% with Joshua A although if you're simply using ascx controls and I'd guess you're not inheriting the cmsabstractwebpart. You're most likely using the User Control webpart to display your ascx controls OR using stratight ASPX templates to display the user controls.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.