标签:
页面代码如下: <%= Html.DropDownList("Category", ViewData["Categories"] as SelectList,"--请选择--",new { @class = "my-select-css-class" } )%> Controllers代码: public ActionResult Create() { List<Category> categories = categoryService.GetAll(); ViewData["Categories"] = new SelectList(categories, "Id", "Name"); return View(); }
标签:
原文地址:http://www.cnblogs.com/sky-net/p/4325503.html