http://msdn.microsoft.com/en-us/library/system.web.mvc.httpdeleteattribute.aspx
Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests.
But what the heck does that mean for example
Mvc
@Html.ActionLink("delete", new {id= model.PrimaryKey})//
Is that a Delete Request? how would the browser differentiate between
@Html.ActionLink("gridDisplay", new {id= model.PrimaryKey})//
controller
[HttpDelete] //what is this how does it know?
public action result delete()
{
delete();//web service deletes something just go with me here
}
public action result gridDisplay()
{
return view()
}
Delete is an HTTP verb, just like GET, PUT, and POST. This attribute restricts the action method to only handle HTTP delete requests.
It’s typical to see this as part of a RESTful web service. This makes it entirely clear that the HTTP request will perform some type of deletion.
You can’t just link to an action that will perform an HTTP delete. A link in a browser will usually issue a GET. I would expect you to get a 404 from clicking that link.