I have a drop down menu in an ASPX page along the lines of:
<form>
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat" selected="selected">Fiat</option>
<option value="audi">Audi</option>
</select>
</form>
That is dynamically generated from another controller (value and label).
After the user selects one of the options I need to find out what the selected value/label (will be the same) is so I can hit an update button and retrieve the data on that option.
What would be the easiest way to find out the value of the user “selected” option?
Either use an<asp:dropdownlist />control.Just realised this MVC.
The simplest way would be to use the
Request.Formcollection, eg:Or you can specify them as properties on your controller:
Or you can use model binders