Try our conversational search powered by Generative AI!

Change mode programatically

Vote:
 
How do redirect to edit mode programatically.
#22810
Aug 17, 2008 23:25
Vote:
 

I'm not sure if you can find the ui path programatically. (Can't believe I haven't written code for that before... :-) )

But, if you add a "editUrl" property to your startpage, and set that to the uiEditUrl, you can use the following code to redirect the users to the edit page:

PropertyData pd = DataFactory.Instance.GetPage(PageReference.StartPage).Property["editUrl"];
if (pd != null && pd.Value != null) {Response.Redirect(pd.Value);}

 

#22895
Edited, Aug 20, 2008 9:53
Vote:
 

The ui path is always available in the episerver settings:

Response.Redirect(EPiServer.Configuration.Settings.Instance.UIUrl + "edit");

And the path to the "edit-mode" is available in the AppSettings in EPiServer 4.x if i remember correctly.

#23006
Edited, Aug 23, 2008 17:26
Vote:
 
I knew there had to be an easier solution hehehe
#23083
Aug 26, 2008 19:22
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.