1.6 KiB
1.6 KiB
title | author | description | ms.author | manager | ms.date | ms.topic | ms.assetid | ms.technology | ms.prod | msc.legacyurl | msc.type |
---|---|---|---|---|---|---|---|---|---|---|---|
How Do I: Use HttpVerbs Attributes in an MVC Application? | Microsoft Docs | rick-anderson | In this video Chris Pels shows how to use the HttpVerbs attributes to control access to MVC actions. First, a sample application is created with a default co... | aspnetcontent | wpickett | 12/30/2009 | article | d2488a1d-0f3f-4994-8fbe-4f59b8c9503e | dotnet-mvc | .net-framework | /mvc/videos/mvc-2/how-do-i/how-do-i-use-httpverbs-attributes-in-an-mvc-application | video |
How Do I: Use HttpVerbs Attributes in an MVC Application?
by Chris Pels
In this video Chris Pels shows how to use the HttpVerbs attributes to control access to MVC actions. First, a sample application is created with a default controller and view for editing the information. Next, a second Index action is added to the controller which has an HttpPost attribute which restricts it to being called only when an HTTP POST is used. As a follow-up, the AcceptVerbs() attribute is implemented as an alternative syntax for Visual Studio 2008. A use of the HttpVerbs for preventing the security risk associated with using an HTTP GET to perform a delete from a link is then discussed.