tags:

views:

714

answers:

1

Can somebody give me an sample code to retreive the item from html.dropdownlist?

A: 

Suppose that 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 simple retrieve the selected value in the controller using

Product.ProductType = form("ProductTypeDropDown")
Eduardo Molteni
I am really sorry for not being clear. Anyways, i want the code to retrieve at the controller side.
umm...I've posted the view and the control side just in case. Did you solved the problem or do you need further assistance?
Eduardo Molteni