Table of Contents

Class RouteAttribute

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

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.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
public sealed class RouteAttribute : Attribute, IDirectRouteFactory, IRouteInfoProvider
Inheritance
RouteAttribute
Implements
Inherited Members

Constructors

RouteAttribute()

Initializes a new instance of the RouteAttribute class.

public RouteAttribute()

RouteAttribute(string)

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

public RouteAttribute(string template)

Parameters

template string

The pattern of the route to match.

Properties

Name

Gets or sets the name of the route.

public string Name { get; set; }

Property Value

string

The name of the route

Order

Gets the order the route is applied.

public int Order { get; set; }

Property Value

int

The order the route is applied.

Template

Gets the pattern for the route to match.

public string Template { get; }

Property Value

string

The pattern to match.