asp.net mvc 3 - How to update a model field without calling the field explicitly in Javascript -
In my MVC3 application, I have a visual model, which I encode Jason, so I manipulate it in Javascript Can i
So suppose I have the following code:
var model =@HTML.Raw (Jason.excode (model)); Currently, the name of model.name is "name".
What I want to do now is another javascript object "obj" which is "value". When you change obj.Value, this model varies. Name.
So I want something: preform var obj = new object (); obj.Value = model.Name; So now, if I obj.Value I change the value of this model, it does not even change the name. I should do this and I am not sure how I can do it in javascript. How do I apply it?
< P> Do not enter names in just a hidden input field. Change the value with whatever JavaScript you choose, in general, when the form is posted back, then you can tie the value of the name in the administrator's action. And the model name server-side can be set. The effort you are making is unnecessarily complex.
If you really want to do this - That's a complete input Submit the JSON string Od. Then bind in JSON as a string in the controller action and Diserilaijh the server-side to store then your model.
Comments
Post a Comment