tags:

views:

29

answers:

3

Is there a way to return to the previous view without having to record all the parameters that were used to get to the view in question. Consider this situation. You have a search screen with input parameters, you press search and get results displayed on the page. You click on one item to get a detailed look which redirects you to a new view. Does MVC have the ability to get the previous query string that contains the search parameters?

A: 

Not that I know of. You could save it in the session, but how about using JS history.back()

Sruly
A: 

Wouldn't the user just use the back button on the browser? Are you wanting to present a "Back to results" link on the detail page? Also look at Request.UrlReferrer if you don't want to save the search parameters in session or a cookie.

RyanW
A: 

You can use Request.UrlReferrer

Bugeo