Table of Contents

Class RoutePrefixAttribute

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

Annotates a controller with a route prefix that applies to all actions within the controller.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class RoutePrefixAttribute : Attribute, IRoutePrefix
Inheritance
RoutePrefixAttribute
Implements
Inherited Members

Constructors

RoutePrefixAttribute()

Initializes a new instance of the RoutePrefixAttribute class.

protected RoutePrefixAttribute()

RoutePrefixAttribute(string)

Initializes a new instance of the RoutePrefixAttribute class with the specified prefix.

public RoutePrefixAttribute(string prefix)

Parameters

prefix string

The route prefix for the controller.

Properties

Prefix

Gets the route prefix.

public virtual string Prefix { get; }

Property Value

string

The route prefix.