Reputation: 46222
I have a value in Jquery. I need to apply that value to a view which has a model. For example, I need to do assign it to the following:
@Html.HiddenFor(model => model.programid)
the variable that I am trying to store in model.programid is called progid.
Upvotes: 0
Views: 348
Reputation: 887305
$('#programid').val(...)
If you're in an editor template, you'll need to add @ViewData.TemplateInfo.HtmlFieldPrefix
Upvotes: 1