ASP.NET MVC Binding issue
Posted
by user295541
on Stack Overflow
See other posts from Stack Overflow
or by user295541
Published on 2010-03-17T10:16:47Z
Indexed on
2010/03/17
10:21 UTC
Read the original article
Hit count: 487
asp.net-mvc
Hi,
I have an object with a property called "name". This object has a sub object that has a property called "name" as well.
Transaction.name
Transaction.TransactionItem
TransactionItem.name
I bind Transaction object to a partial control as usual:
Html.TextBox("name", Model.name)%>
Model is a Transaction object.
And I bind TransactionItems:
< if (Model.mtTransactionItem != null) { foreach (var item in Model.mtTransactionItem) { %> <%= Ajax.ActionLink(item.name, "ShowItem", new { id = item.id }, new AjaxOptions { UpdateTargetId = "dialog-form" })%>
And when I update the one of the transaction items through an ajax call I pass the entire transaction object to the partial view.
When I debug I check the Model.name property, and it has a proper value. But on the page shows the name of TransactionItem value instead of the name of Transaction value.
What do I do wrong?
I have checked this problem in MVC 1.0 and MVC 2.0 framework.
© Stack Overflow or respective owner