ASP.NET MVC: HttpGet action filter
HttpGet action method selector attribute restrict action method so that marked action method would be served for only HTTP GET verb. Similar to HttpPost, HttpGet also inherited from ActionMethodSelectorAttribute.
Attribute Usage: Only method
Sample Code:
[HttpGet]
public ActionResult About()
{
return View();
}
When action method is decorated with HttpGet attribute, then those action methods are accessible only via HTTP GET request. Request via other HTTP method will fail and return HTTP 404 not found error.
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.