Table of Contents

Class ActionNameAttribute

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Represents an attribute that is used for the name of an action.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class ActionNameAttribute : ActionNameSelectorAttribute
Inheritance
ActionNameAttribute
Inherited Members

Constructors

ActionNameAttribute(string)

Initializes a new instance of the ActionNameAttribute class.

public ActionNameAttribute(string name)

Parameters

name string

Name of the action.

Exceptions

ArgumentException

The name parameter is null or empty.

Properties

Name

Gets or sets the name of the action.

public string Name { get; }

Property Value

string

The name of the action.

Methods

IsValidName(ControllerContext, string, MethodInfo)

Determines whether the action name is valid within the specified controller context.

public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo)

Parameters

controllerContext ControllerContext

The controller context.

actionName string

The name of the action.

methodInfo MethodInfo

Information about the action method.

Returns

bool

true if the action name is valid within the specified controller context; otherwise, false.