[ASP.NET MVC] Model Binding to List Of Objects

Showing a single record for editing is common and the default model binding of ASP.NET MVC takes care of mapping the form to the model properties. But, there are times where you need to edit multiple records, like when you want to display an editable grid to the end user filled with existing data. The user can edit values from multiple rows then hit save to attempt to save the data. In this case, multiple objects are submitted and is no longer valid. By tweaking form field names, you can get this to work as expected.

First, create an new ASP.NET MVC application then follow this guide: http://www.dotnetbips.com/articles/b1e0b153-47f4-4b29-8583-958aa22d9284.aspx

Leave a Reply

Your email address will not be published. Required fields are marked *