ASP.NET MVC Model Binding
- by Noel
If i have a Controller Action that may recieve both HTTP GET and HTTP POST from a number of different sources with each source sending different data e.g.
Source1 performs a form POST with two form items Item1 and Item2
Source2 performs a GET where the data is contained in the query string (?ItemX=2&ItemY=3)
Is it possible to have a controller action that will cater for all these cases and perform binding automatically e.g.
public ActionResult Test(Dictionary data)
{
// Do work ...
return View();
}
Is this possible with a custom binder or some other way?
Dont want to work directly with HttpContext.Request if possible