CONNECT WITH US

Featured Post

ASP.NET MVC: HttpDelete action filter

Get article update by Email
ASP.NET MVC: HttpDelete

HttpDelete action method selector attribute is used whenever we want to restrict action method to be accessible only via HTTP DELETE verb. Similar to HttpPost & HttpGet, HttpDelete also inherited from ActionMethodSelectorAttribute.

Attribute Usage: Only method

Sample Code:

[HttpDelete]
public ActionResult About()
{
    return View();
}

Once we marked action method with HttpDelete attribute, it will throw an HTTP 404 not found error if we try to access it with other HTTP 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.

0 comments:

Post a Comment