标签:tostring 下拉框 use html open nbsp span real text
1 下拉框
List<Model.Sys.AccountModel> AcModel = BLL.Sys.AccountBLL.Instance.GetModelList("RoleID=3"); //实例化 // SelectList ServiceName = new SelectList(new List<Model.Sys.AccountModel>(), "ID", "RealName"); //下拉框 SelectList ServiceName = new SelectList(AcModel, "ID", "RealName"); ViewData["ServiceName"] = ServiceName; //页面显示 @Html.DropDownList("ServiceUserID", (SelectList)ViewData["ServiceName"], "全部") List<SelectListItem> lists = new List<SelectListItem>(); lists.Add(new SelectListItem { Text = "未到期", Value ="0" }); lists.Add(new SelectListItem { Text = "到期已还", Value = "1" }); lists.Add(new SelectListItem { Text = "延期已还", Value = "2" }); lists.Add(new SelectListItem { Text = "未到期", Value = "3" }); //for (int i = 1; i <= 12; i++) //{ // lists.Add(new SelectListItem { Text = i + "月", Value = i.ToString() }); //} ViewBag.lists = lists; //页面显示 @Html.DropDownList("ServiceUserID", (List<SelectListItem>)ViewBag.lists)
标签:tostring 下拉框 use html open nbsp span real text
原文地址:http://www.cnblogs.com/zhangtaotqy/p/7881634.html