现在的需求是:下拉框中要是选择加盟商让其继续选择学校,要是选择平台管理员则不需要选择学校。隐藏选择下拉列表。
选择枚举值:
/// 平台角色
///
public enum AdministratorRole
{
[Display(Name = "平台管理员")]
PlatformAdministrator = 1,[Display(Name = "加盟商")]
JoiningTrader = 10
}
代码:
x.AdministratorRole,new { @class = "col-sm-2 control-label" })
x.AdministratorRole,new { @class = "form-control",onChange = "showSchool(this.value)",placeholder = Html.DisplayNameFor(x => x.AdministratorRole) })
x.AdministratorRole)