This is my first MVC app and I'm not sure how to use a parameter to filter the returned data. I'm using MVC2 and Visual Studio 2008.
How do I filter view results based on user input? I want the user to be able to enter an ID number in a textbox and then click a button to get results filtered by the ID they entered.
here is my Controller
public class HelloWorldController : Controller
{
UAStagingEntities db = new UAStagingEntities();
public ActionResult Index()
{
var depot = from m in db.CSLA_DEPOT
where m.DEPOT_ID==10057
select m;
return View(depot.ToList());
}
}
how do I change this to accept a paramter instead of a hard coded ID?