save variable from <select> in View into the ViewModel ASP-NET MVC

So I have a ViewModel with this attribute

public string number { get; set; }

And in my View I have the next drop down list:

    <option value="1">one</option>
    <option value="2">two</option>
    <option value="3">three</option>
    <option value="4">four</option>

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.

Source: html

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.