I have an application built in MVC5 with c#. I have 5 dropdowns on my view.
These dropdowns are partialviews. Content of dropdowns:-
1) list of cities
2) list of events.
3) list of venues
4) list of dates
5) list of times
so when page is first loaded the cities are populated. when I select a city, second dropdown is populated with list of events. and now when I select a event the next dropdown is populated with Venues. and the same process happens for all of the dropdowns.(ofcourse there in no change event for times dropdown as it is last).
now there is a submit button when I click this button it redirects me to new page using controllers method. Signature is as follows
public ActionResult Redirect(string hdn_city, string hdn_event, string hdn_date, string hdn_venue, string hdn_time)
{
string urls = String.Format("mysite.com?cid={0}&eid={1}&did={2}&vid={3}&tid={4}", hdn_city, hdn_event, hdn_date,hdn_venue,hdn_time);
return Redirect(urls);
}
now when I submit this form I am redirected to mysite.com with all the params passed in query string.
Now my problem is that it is required if after reaching mysite.com i press browser back button the values of dropdown should persist. I dont have to repeat the whole process again. Please suggest me possible alternatives.