Why not put data in a Session , as you say?
public ActionResult Search(string searchCriteria) { Session["searchCriteria"] = searchCriteria;
Thus, you have search criteria, no matter how many βback-clicksβ a user makes.
You can make it a lot harder, but I don't think it is necessary in this case. If you want to pass it as route data in an action link, you will have to protect the searchCriteria parameter for each ActionLink page that the user can go to from the search page. This makes it much more cumbersome in my opinion.
Good enough, sometimes enough. Refactor later as needed. :)
source share