London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Here is how we do it:
var pageReference = ???
var urlResolver = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<EPiServer.Web.Routing.UrlResolver>();
var pageUrl = urlResolver.GetVirtualPath(pageReference);
Redirect(pageUrl);
Look here for more information: http://joelabrahamsson.com/episerver-7-and-mvc-getting-the-url-for-a-page/
Greetings
Hi,
just taking my baby steps in the world of MVC and EPi. What is correct way to redirect from controller to another page provided that I have the redirection target as PageReference/PageData?
I was looking at RedirectToRoute but couldn't yet figure out how to resolve route for page from PageReference/PageLink?
Response.Redirect of course works but seemed to as not the most elegant solution? Or I am just making simple task too complicated?
Any advice appreciated!