0
我使用MVC4,我想添加CSS CLSS在下拉列表下面的语法与缺省值如何在下拉列表中添加类在MVC4 Razor视图
@Html.DropDownList("CategoryId","Select", new { @class = "form-control" })
,但它给了我下面的错误
CS1928: 'System.Web.Mvc.HtmlHelper<Test.Models.M_Product>' does not
contain a definition for 'DropDownList' and the best extension method overload
'System.Web.Mvc.Html.SelectExtensions.DropDownList(System.Web.Mvc.HtmlHelper, string,
System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem>,
object)' has some invalid arguments
任何人都可以帮助我。
在此先感谢。
对不起,但它没有帮助.. – User125
奇怪的是,更多的细节,我会为你写。 –
我想用默认的文本和自定义css ..so绑定数据库的下拉列表,请给我任何想法 – User125