HTML.DropDownListFor class assignment
问题 Is it possible to assign my own class to the HTML.DropDownListFor() helper? 回答1: One of the overloaded method has an object htmlAttributes as last parameter in which you can specify extra attributes to be added to the generated html: Html.DropDownListFor(..., new { "class" = "myclassname" }; http://msdn.microsoft.com/library/ee703670.aspx 回答2: Didier's answer is mostly correct, but to define a class value in htmlAttributes object, you need to use this syntax: Html.DropDownListFor(..., new {