C# 杂活
标签:tostring 下拉框 use html open nbsp span real text
1 下拉框
List AcModel = BLL.Sys.AccountBLL.Instance.GetModelList("RoleID=3");
//实例化
// SelectList ServiceName = new SelectList(new List(), "ID", "RealName");
//下拉框
SelectList ServiceName = new SelectList(AcModel, "ID", "RealName");
ViewData["ServiceName"] = ServiceName;
//页面显示
@Html.DropDownList("ServiceUserID", (SelectList)ViewData["ServiceName"], "全部")
List lists = new List();
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 //{
// lists.Add(new SelectListItem { Text = i + "月", Value = i.ToString() });
//}
ViewBag.lists = lists;
//页面显示
@Html.DropDownList("ServiceUserID", (List)ViewBag.lists)
MVC 下拉框
C# 杂活
标签:tostring 下拉框 use html open nbsp span real text
原文地址:http://www.cnblogs.com/zhangtaotqy/p/7881634.html
文章来自:
搜素材网的
编程语言模块,转载请注明文章出处。
文章标题:
C# 杂活
文章链接:http://soscw.com/index.php/essay/79870.html
评论