Try our conversational search powered by Generative AI!

MVC - How to get a specific page data so I can redirect to it?


I have a login form on my layout which posts to a controller that uses Membership to validate the user.

Once validated, I want to redirect them to a specific page.

How do I do this the "EPiServer Way"? I could just enter the url manually but that doesn't feel right. I also need to take into consideration which language branch the user is currently using.

Oct 31, 2013 16:15

Would it not just be ?

var page = DataFactory.Instange.GetPage(pageRef);




 var repository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();

 var v = repository.Get<IContent>(new ContentReference(intValue));


Oct 31, 2013 16:37

So I need to know the id of the page so that I can pass that into the ContentReference constructor?

Oct 31, 2013 16:54

Yes all page's have a PageReference

Oct 31, 2013 16:56

You can store this ID either in a config file, database table or store it as a property on a page type (start page normally).

Oct 31, 2013 19:09
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.