I'm struggling to add a background color to this drop-down menu. I tried including new{style="background-color: #fff;"} in the code below, but it doesn't seem to be working as expected. How can I achieve this?
<%=Html.DropDownList("dd",
new List<SelectListItem>
{
new SelectListItem{ Text="dd1", Value = "dd1" },
new SelectListItem{ Text="dd2", Value = "dd2" }
}
, new { onchange = "jsfunc()" }
)%>
This is what I attempted:
<%=Html.DropDownList("dd",
new List<SelectListItem>
{
new SelectListItem{ Text="dd1", Value = "dd1" },
new SelectListItem{ Text="dd2", Value = "dd2" }
}
, new { onchange = "jsfunc()" }
, new {style="background-color: #fff;"}
)%>