1 public ActionResult xx([Bind(Exclude = "id")] xxModel xx, HttpPostedFileBase file)//排除id验证 2 3 //Bind(Include="name,age") 只允许name和age验证
ModelState.Remove("Name")//另一种排除验证方式
1 public ActionResult xx([Bind(Exclude = "id")] xxModel xx, HttpPostedFileBase file)//排除id验证 2 3 //Bind(Include="name,age") 只允许name和age验证
ModelState.Remove("Name")//另一种排除验证方式