首页 > 其他 > 详细

Bind[Exclude|Include]排除字段或只允许字段验证

时间:2015-07-15 16:51:26      阅读:1277      评论:0      收藏:0      [点我收藏+]
1  public ActionResult xx([Bind(Exclude = "id")] xxModel xx, HttpPostedFileBase file)//排除id验证
2 
3 //Bind(Include="name,age") 只允许name和age验证

 

ModelState.Remove("Name")//另一种排除验证方式


      

Bind[Exclude|Include]排除字段或只允许字段验证

原文:http://www.cnblogs.com/X-Jonney/p/4648656.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!