How do the httppost, httpput etc attributes in ASP.NET MVC 2 work?
- by Tomas Lycken
In ASP.NET MVC 2, a couple of new action filter attributes were introduced, as "shorthand" for attributes in ASP.NET MVC 1; for example, applying the HttpPostAttribute does the same thing as applying [AcceptVerbs(HttpVerbs.Post)] to an action method.
In addition, with the more verbose syntax, it is possible to combine different methods, in order to allow for example both Post and Delete.
Now I'm wondering: how do the new attributes work? If I apply both [HttpPost] and [HttpDelete], will ASP.NET MVC 2 allow both or require both (thus allowing nothing)?