Hi
I am wondering how we can set the width of the Dropdown. When i write the below line of code, I am getting compilation error.
<%= Html.DropDownList("product", ViewData["product"], new { style = "width: 300px;"})%>
Appreciate your responses.
Hi
I am wondering how we can set the width of the Dropdown. When i write the below line of code, I am getting compilation error.
<%= Html.DropDownList("product", ViewData["product"], new { style = "width: 300px;"})%>
Appreciate your responses.
<%= Html.DropDownList("product", (SelectList) ViewData["product"], new { style = "width: 300px;"})%>
because I think ViewData["product"] is considered as object so its thinks it is the overload html attributes