The ASP.net page I am currently working on has a drop down list that is intended to have a list of filters. When the user selects the filter, I would like to display a user control that has properties appropriate for the filter.
Here is the controller action in question:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(FormCollection collection)
{
var filterType = Request.Form["FilterSelect"];
ViewData["FilterChosen"] = filterType;
PopulateSelectionFiltersData();//This method fills up the drop down list
//Here is where I would like to switch based on the filterType variable
return View();
}
The filter type variable has the correct value, but I'm unsure as to how to do the next part.
Also, as a corollary question, what would be the best way to persist the selected drop down value between calls?
Many thanks,
KevDog