[AllowAnonymous]
public ActionResult Register()
{
ViewBag.roleList = DALUser.GetRoleList();
ViewBag.stateList = DALUser.GetStateList();
return View();
}
<li>
@Html.LabelFor(m => m.role)
@Html.DropDownListFor(m => m.role, new SelectList(ViewBag.roleList, "Select Role"))
</li>
它导致
“值不能为空。参数名称:项目”。roleList 和 stateList 只是字符串列表
有人对此有想法吗?