ASP.NET MVC: HttpPut action filter
In this ASP.NET MVC action filter tutorial series, HttpPut is 4th attribute which allow developer to restrict action method access based on HTTP verb. As name suggest, HttpPut marked action method will be accessible only via HTTP PUT verb. Similar to HttpPost, HttpGet & HttpDelete, HttpPut also inherited from ActionMethodSelectorAttribute.
Attribute Usage: Only method
Sample Code:
[HttpPut]
public ActionResult About()
{
return View();
}
Alike other action filter, We can’t access HttpPut marked method with other than HTTP PUT verb.
Check out ASP.NET MVC: Action filter series post to read about other available action filters.
You can follow me on twitter for latest link and update on ASP.NET & MVC.