I’m writing a project in mvc 3.
I want to set an object in a view using razor.
To get the value I did this: @Model.UserName; and I do get the user name.
My question is how can I set the user name. I want to do something like: @Model.userName="xxx";
Thank in advance:)
Here is what solved my problem:
In javascript:
In razor:
and all in the same view.