All Namespaces

  • Namespaces
    • AjaxControlToolkit
    • com
    • CrystalDecisions
    • DevExpress
    • DocumentFormat
    • Dundas
    • Ilrun
    • MediaCenter
    • Microsoft
    • MS
    • ServiceBus
    • Spaanjaars
    • SqlContracts
    • System
      • Activities
      • AddIn
      • CodeDom
      • ComponentModel
      • Configuration
      • Data
      • Design
      • Diagnostics
      • DirectoryServices
      • Drawing
      • Dynamic
      • EnterpriseServices
      • IdentityModel
      • IO
      • Linq
      • Management
      • Messaging
      • Net
      • Printing
      • Reflection
      • Resources
      • Runtime
      • Security
      • ServiceModel
      • ServiceProcess
      • Timers
      • Transactions
      • Web
        • Compilation
        • DynamicData
        • Hosting
        • Mobile
        • Mvc
        • Profile
        • Razor
        • Script
        • Services
        • UI
        • WebPages
      • Windows
      • Workflow
      • Xml
    • WindowsFormsIntegration


Name: AcceptVerbsAttribute
Namespace: System.Web.Mvc
Inherits from: System.Web.Mvc.ActionMethodSelectorAttribute
Short description: Represents an attribute that specifies which HTTP verbs an action method will respond to.
Added: 2009-02-14
Last modified: 2009-06-14
External help:
Added by: Imar Spaanjaars
Can be used on:
Assembly Class Interface
Method Property Field
Constructor Struct Enum
Event Parameter Delegate
ReturnValue Generic Parameter Module
Available in:
Defined in:
  • System.Web.Mvc.dll (
  • System.Web.Mvc.dll (
  • System.Web.Mvc.dll (
  • System.Web.Mvc.dll (
No Sealed? Yes
Yes Internal? No
Allow multiple?
No Obsolete? No
Full description:

When you apply the AcceptVerbs attribute to an overloaded action method in a controller, ASP.NET MVC will trigger the right action method based on the HTTP verb.

Class diagram:
This diagram is autogenerated and may contain errors.
Please report them if you find them.

Code examples

Below you find a list of code examples that have been added for this attribute.

Language: C#    Posted by: Imar Spaanjaars    Date added: 6/14/2009

To have an action method in an ASP.NET MVC Controller handle post requests, you apply the attribute as follows:

public ActionResult Edit(int id, FormCollection formContents)
  // Implementation to handle an Edit POST here

Specifying HttpVerbs.Get or leaving out the attribute altogether marks the method as a GET request handler.

If you want to add a code example, you need to log in first. Don't have account? You can sign up for one right now.


Below you find a list of links that are relevant for this attribute.

Free — Scott Guthrie's (ScottGu) chapter!

If you want to add a link, you need to log in first. Don't have account? You can sign up for one right now.