I am using an id value which I pass in a hidden area. When the user submits the form, I need a hidden field for my updates. After the update, a new value is kept in the hidden field in the model and sent back to the view. It seems weird that the assistant always uses the first value, never updates. For example, see:
& lt;%: Html.Hidden ("MyId", Model.MyId)%> & Lt;%: Model.MyId% & gt;
The first time on the source in browser yields:
& lt; Input type = "hidden" id = "myId" name = "myId" value = "1" /> 1
** Submit the Controller and Model update back to MyId Property 2.
Come back to the browser that I'm getting now:
2
The values of the very model property are different! Is the method helpful to grab the first model or some things with it?
What I can not understand with any help. BTW .. Html.TextBox
and Html.TextBoxFor
. Treat the same with
thanks
. Similarly, HTML helpers work and this is done by the design when they will first assume value in the GET / POST request, whether the value is present and its value. In the later model If a value is found in the request, then they will only ignore the price you set in the model.
Normally you should not modify the data sent in the request within your controller action. But if you decide to do this in any way, then you have to either roll your own assistant or simply:
Comments
Post a Comment