So I have a ViewModel with this attribute
public string number { get; set; }
And in my View I have the next drop down list:
<select>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
</select>
How do I save the value that gets selected on the drop down list into the number
attribute from my ViewModel?
Usually I would use @Html.DropDownListFor(m => m.number, listObject)
but the dropdownlist that I'm trying to create has to be dynamically created with JQuery, therefore I can't use the HtmlHelper.
EDIT: As answered in the comments, what I want to accomplish may be possible with the html helper but I wanted to avoid that.