I\'m using ASP.NET MVC, and am trying to render a select list with the HtmlHelper.DropDownListFor method, like so:
<%= Html.DropDownListFor(x => x.AllT
DropDownList and derivatives don't support the functionality you're looking for. But you could also simply process the string returned by DropDownList.
<%=
Html.DropDownListFor(x => x.AllTopics,
SelectListHelper.GetSelectListItems(Model.AllTopics),
"Select a Topic",
new { id = "allTopics", @class = "topic-dropdown" })
.Replace("