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