Model Binding To A List

Posted by: youve been HAACKED, on 24 Oct 2008 | View original

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! Its really easy if youre 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...

Advertisement
The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.

Similar Posts

  • The lists to blogs transition more
  • Response: Visual Studio should be part of Windows more
  • Typed XML programmer -- What are your pains today? more
  • Learn System.Net, WCF and Atlas at next MSDN Event more
  • Yield to the power of the DataSource more
  • .NET Generic Types more
  • CaptainHook Is On SourceForge more
  • Sharepoint 2007: List Events Practical Example: Creating a rigged survey!! more
  • Announcing DNN Guru (dnnguru.com) for Professional DNN developers more
  • Seven deadly sins of programming - Sin #2 more

News Categories

.NET | ADO.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Community Server | dasBlog | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD