您好我正在尝试将表单中的选择控件的内容发布到MVC控制器。当我发布数据时,它会绕过model.isvalid代码块。 有谁知道我可能做错了什么?
我的控制器中的操作:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit([Bind(Include = "Id,SignatureStream,LogoStream,CompanyHeader,MasterAccount,Name,AccountType,NoReporting,Prefix,Permissions")] UserSettingsViewModel userSettingsViewModel)
视图模型:
public IList<Permission> Permissions { get; set; }
[Required]
public Guid Id { get; set; }
public byte[] SignatureStream { get; set; }
public byte[] LogoStream { get; set; }
public String CompanyHeader { get; set; }
public Guid? MasterAccount { get; set; }
public String Name { get; set; }
public int? AccountType { get; set; }
public bool? NoReporting { get; set; }
public String Prefix { get; set; }
我的CHTML中的选择控件(有一些角度):
<select multiple hidden name="Permissions" id="Permissions">
<option selected ng-repeat="permission in Permissions track by $id($index)" value="{{permission.PermissionName}}">{{permission.SatelliteAccount}}</option>
</select>
截屏形式fiddler: