ASP.NET MVC: View does not get rendered with updated model value

Posted by Newton on Stack Overflow See other posts from Stack Overflow or by Newton
Published on 2010-05-20T07:36:12Z Indexed on 2010/05/20 7:40 UTC
Read the original article Hit count: 236

Filed under:
|
|
|

I'm experiencing the a challenge in populating the child records. My previous code was like -

<%= Html.TextBox("DyeOrder.Summary[" + i + "].Ratio", Model.DyeOrder.Summary[i].Ratio.ToString("#0.00"), ratioProperties)  %>

This code does not render the updated values after post back. To resolve this issue my work around was like -

<%= "<input id='DyeOrder_Summary_" + i + "__Ratio' name='DyeOrder.Summary[" + i + "].Ratio'  value='" + Model.DyeOrder.Summary[i].Ratio.ToString("#0.00") + "' " + ratioCss + "  type='text' />"%>

This is very clumsy to me. Is there any better ideas...

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about htmlhelpers