0
点赞
收藏
分享

微信扫一扫

MVC的 @Html.DropDownList()的一种用法

拾杨梅记 2022-09-06 阅读 182


前台代码

@Html.DropDownList("SerialName", ViewBag.selList1 as IEnumerable<SelectListItem>, new { @class = "form-control"})


后台cs代码

public ActionResult Login(string returnUrl)
{
ViewBag.selList1 = new SelectList(new String[] { "a", "b", "c" });
return View();
}


这样直接可以

举报

相关推荐

0 条评论