RouteAttribute RouteAttribute RouteAttribute Class


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


RouteAttribute() RouteAttribute() RouteAttribute()

Initializes a new instance of the RouteAttribute class.

RouteAttribute(String) RouteAttribute(String) RouteAttribute(String)

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


Name Name Name

Gets or sets the name of the route.

Order Order Order

Gets the order the route is applied.

Template Template Template

Gets the pattern for the route to match.

Explicit Interface Implementations

IDirectRouteFactory.CreateRoute(DirectRouteFactoryContext) IDirectRouteFactory.CreateRoute(DirectRouteFactoryContext) IDirectRouteFactory.CreateRoute(DirectRouteFactoryContext)

Creates a direct route entry.

Applies to