views:

37

answers:

1

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?

+1  A: 

Either use an <asp:dropdownlist /> control.

Just realised this MVC.

The simplest way would be to use the Request.Form collection, eg:

Request.Form["cars"]

Or you can specify them as properties on your controller:

public ActionResult ControllerMethod(string cars){...}

Or you can use model binders

DaRKoN_
Yeah was just working on pretty much what you posted but was a tad confused with it still. Thanks :)
Thqr