I have a requirement to add conditional disabled & class attributes to a dropdown form element. I have the following however it does not write out either of the attributes in any state. Is there a way around this.
<%= Html.DropDownList("--Choose Make--", "models", ViewData["model_disabled"] == "false" ? new { @disabled = "disabled", @class = "test" } : null)%>