C# 在MVC/ASPX中,FormAttribute和BindAttribute之间有什么区别

C# 在MVC/ASPX中,FormAttribute和BindAttribute之间有什么区别,c#,asp.net,asp.net-mvc,C#,Asp.net,Asp.net Mvc,我是MVC新手。 两者之间有什么区别 public ActionResult MyAction([Form] MyClass myClass) {...} 及 另外,绑定属性的默认行为是什么?我是说,在这种情况下 public ActionResult MyAction([Bind] MyClass myClass) {...} 行为是全部包含还是全部排除?[Bind]不需要参数-默认情况下,所有匹配的表单值、查询字符串值等都会绑定。什么是[Form]?System.Web.ModelBin

我是MVC新手。 两者之间有什么区别

public ActionResult MyAction([Form] MyClass myClass) {...}

另外,绑定属性的默认行为是什么?我是说,在这种情况下

public ActionResult MyAction([Bind] MyClass myClass) {...}

行为是全部包含还是全部排除?

[Bind]
不需要参数-默认情况下,所有匹配的表单值、查询字符串值等都会绑定。什么是
[Form]
?System.Web.ModelBinding.FormAttribute。我认为它与没有参数的Bind完全相同,但我不确定。
System.Web.ModelBinding.FormAttribute
不是MVCI使用的。我在读一本书,(ASP.NET MVC 5,带Bootstrap和Knockout.js,Jamie Munro,O'Reilly,2015年5月),并在某一点构建MVC应用程序作者使用FormAttribute(第57页)。我不明白为什么。
[Bind]
没有参数是不必要的-默认情况下,所有匹配的表单值、查询字符串值等都是绑定的。什么是
[Form]
?System.Web.ModelBinding.FormAttribute。我认为它与没有参数的Bind完全相同,但我不确定。
System.Web.ModelBinding.FormAttribute
不是MVCI使用的。我在读一本书,(ASP.NET MVC 5,带Bootstrap和Knockout.js,Jamie Munro,O'Reilly,2015年5月),并在某一点构建MVC应用程序作者使用FormAttribute(第57页)。我不明白为什么。
public ActionResult MyAction([Bind] MyClass myClass) {...}