ASP.Net-MVC code example to retrieve selected item from html dropdown list
1 answer
Suppose you have this DropDown in the view:
<p><label for="ProductType">Product Type:</label>
<br /><%=Html.DropDownList("ProductTypeDropDown",
New SelectList(ViewData("ProductTypes"),
"ProductTypeID", "Name"))%>
</p>
You can just get the selected value in the controller using
Product.ProductType = form("ProductTypeDropDown")
0
a source to share