RouteAttribute Class

Definition

Place on a controller or action to expose it directly via a route. When placed on a controller, it applies to actions that do not have any System.Web.Mvc.RouteAttribute’s on them.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public sealed class RouteAttribute : Attribute, System.Web.Mvc.Routing.IDirectRouteFactory, System.Web.Mvc.Routing.IRouteInfoProvider
type RouteAttribute = class
    inherit Attribute
    interface IDirectRouteFactory
    interface IRouteInfoProvider
Public NotInheritable Class RouteAttribute
Inherits Attribute
Implements IDirectRouteFactory, IRouteInfoProvider
Inheritance
RouteAttribute
Attributes
Implements

Constructors

RouteAttribute()

Initializes a new instance of the RouteAttribute class.

RouteAttribute(String)

Initializes a new instance of the RouteAttribute class with the specified template.

Properties

Name

Gets or sets the name of the route.

Order

Gets the order the route is applied.

Template

Gets the pattern for the route to match.

Explicit Interface Implementations

IDirectRouteFactory.CreateRoute(DirectRouteFactoryContext)

Creates a direct route entry.

Applies to