views:

147

answers:

2

This construction below using dropdownlist does not work!!

<% = Html.DropDownList (ddlUf, "All", New With (. Class = "text"})%>

It only works if I do this:

<% = Html.DropDownList (ddlUf, "All")%>

Or this:

<% = Html.DropDownList (ddlUf, Nothing, New With (. Class = "text"})%>

How do I solve this problem?

Thanks

+1  A: 

use new{ @class = "text"})

QuBaR
Looks like he's using VB.NET to me.
Kezzer
for vb one could use New with { [Class] = "text" }
adriaanp
A: 

I think you have the order of parameters mixed up. Assuming that ddlUf is a string with the DropDownList name, and "All" is supposed to be the default option, then you need something like this:

<% =Html.DropDownList(ddlUf, Model.FullListOfSelectListItems, "All", New With (. Class = "text") %>
Agent_9191