Author: you've been HAACKED | Posted on: 10/23/2008 10:50:12 PM | Views : 789

Using the DefaultModelBinder in ASP.NET MVC Beta, you can bind submitted form values to arguments of an action method. But what if that argument is a list? Can you bind a posted form to an IList<T>? Sure thing! It?s really easy if you?re posting a bunch of simple types. For example, suppose you have the following action method. public ActionResult UpdateInts(IList< int > ints) { return View(ints); } You can bind to that by simply submitting a bunch of form fields which each have the same name. For example, here?s an example of a form that would bind to this, assuming you keep each value a proper integer. < form method ="post" action ="/Home/UpdateInts" > < input type ="text" name ="ints"...(read more) ...

Go to the complete details ...