A simple example would be something like this:
Index.cshtml:
@using (Html.BeginForm("Results", "Search", FormMethod.Get))
{
@Html.TextBox("searchCriteria")
<input type="submit" value='Search' />
}
Then the controller:
public class SearchController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Results(string searchCriteria)
{
var model = // ... filter using searchCriteria
return View(model);
}
}
model
could be of type ResultsViewModel
, which would encase everything you need to display the results. This way, your search is setup in a RESTful way - meaning it behaves consistently each time.