25 lines
1.6 KiB
Markdown
25 lines
1.6 KiB
Markdown
|
---
|
||
|
title: "How Do I: Use HttpVerbs Attributes in an MVC Application? | Microsoft Docs"
|
||
|
author: rick-anderson
|
||
|
description: "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..."
|
||
|
ms.author: aspnetcontent
|
||
|
manager: wpickett
|
||
|
ms.date: 12/30/2009
|
||
|
ms.topic: article
|
||
|
ms.assetid: d2488a1d-0f3f-4994-8fbe-4f59b8c9503e
|
||
|
ms.technology: dotnet-mvc
|
||
|
ms.prod: .net-framework
|
||
|
msc.legacyurl: /mvc/videos/mvc-2/how-do-i/how-do-i-use-httpverbs-attributes-in-an-mvc-application
|
||
|
msc.type: video
|
||
|
---
|
||
|
How Do I: Use HttpVerbs Attributes in an MVC Application?
|
||
|
====================
|
||
|
by [Chris Pels](https://twitter.com/chrispels)
|
||
|
|
||
|
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.
|
||
|
|
||
|
[▶ Watch video (16 minutes)](https://channel9.msdn.com/Blogs/ASP-NET-Site-Videos/how-do-i-use-httpverbs-attributes-in-an-mvc-application)
|
||
|
|
||
|
>[!div class="step-by-step"]
|
||
|
[Previous](how-do-i-work-with-model-binders-in-an-mvc-application.md)
|
||
|
[Next](mvc2-html-encoding.md)
|