Nested Model binding in ASP.NET MVC2. fields_for from rails equivalent

Posted by dagda1 on Stack Overflow See other posts from Stack Overflow or by dagda1
Published on 2010-04-04T14:20:24Z Indexed on 2010/04/04 14:23 UTC
Read the original article Hit count: 372

Filed under:

Hi,

I am looking for some examples of how to do model binding in ASP.NET MVC2 for COMPLEX objects.

All the exmples I can find are of simple objects with no child collections or child objects.

If I have an Expense object with a child ExpensePayment object.

In rails, child objects are rendered with the HTML name attributes like this:

expense[expense_payment][net]

Rails uses fields_for to render child objects.

How can I accomplish something similar in ASP.NET MVC2?

Cheers

Paul

© Stack Overflow or respective owner

Related posts about asp.net-mvc