MVC接收强类型对象时排除或只接收某几个属性使用Bind特性
1 只接收几个属性:Bind(Include="属性1,属性2,属性3,...") 2 排除某几个属性:Bind(Exclude="属性1,属性2,属性3,...")
例子:
public ActionResult Login([Bind(Include="UserName,UserPwd")]UserInfo user) { return View(); }
原文:https://www.cnblogs.com/dangpengfei/p/11124306.html