I’m new to MVC3. I would like to create a select list / dropdown that will allow me to select between 2-3 things. I only want to be able to select the one from a list. Is there an easy way to do this with a helper.
Mary Jean
Here’s my idea.
The helper will select from choices:
1 answer
2 answers
3 answers
and store the result in task_type variable
You could use the
DropDownListForhelper. I would start by defining a view model:then a controller:
and finally a strongly typed view:
Now when the user submits the form the Index POST action will be invoked and the
SelectedAnswerproperty of the view model will be automatically populated with the user selection from the dropdown.