Model Binding To A List

Posted by: youve been HAACKED, on 24 Oct 2008 | View original | Bookmarked: 0 time(s)

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
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 787 | Hits: 20

Similar Posts

  • ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities more
  • "Oslo" at the 2009 PDC more
  • Spec Explorer: A Model-Based Testing tool more
  • What needed to be monitored to get better Governance more
  • EF4: Lazy Loading on By Default but what about pre Beta 2 Models? more
  • SharePoint 2010 Workflow more
  • LINQ to SQL, Lazy Loading and Prefetching more
  • Getting Loopy (Matt Gertz) more
  • Silverlight, MVVM, Prism and More at VSLive Orlando more
  • ASP.NET MVC 2 Preview 2 more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | 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