ASP.NET MVC Binding issue
- by user295541
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.