views:

47

answers:

1

Hi, is there a way to get or store the last page visited? Example if I'm on a List Page with a New link that loads a page with form. If the user cancels, you go back to the previous page (List Page).

Thanks

+1  A: 

Hey,

Well, in web forms, you would use: Request.UrlReferrer

http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx

So I assume you can also use that in MVC, accessible through the HttpContext property of the RequestContext acessible by teh controller.

Brian
thanks for the quick reply, found the same idea here: http://www.velocityreviews.com/forums/t102171-go-back-to-previous-page-when-cancel-button-hit.html
poldo