Table of Contents

Class RegisterWebPageRouteAttribute

Namespace
Kentico.Content.Web.Mvc.Routing
Assembly
Kentico.Content.Web.Mvc.dll

Registers a web page route definition to be used within the router feature.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public class RegisterWebPageRouteAttribute : Attribute, IPreInitAttribute
Inheritance
object
Attribute
RegisterWebPageRouteAttribute
Implements
Extension Methods

Remarks

The route is active for all website channels by default. For a specific website channel restriction use the WebsiteChannelNames property.

Constructors

RegisterWebPageRouteAttribute(string, Type)

Creates an instance of the RegisterWebPageRouteAttribute class.

public RegisterWebPageRouteAttribute(string contentTypeName, Type controllerType)

Parameters

contentTypeName string

The content type this route is registered for.

controllerType Type

Type of the registered page controller.

Properties

ActionName

The name of the controller action method that handles the request.

public string ActionName { get; set; }

Property Value

string

ContentTypeName

The content type this route is registered for.

public string ContentTypeName { get; }

Property Value

string

MarkedType

The type of the registered controller.

public Type MarkedType { get; }

Property Value

Type

Path

The tree path specifying the location of a web page in the content tree.

public string Path { get; set; }

Property Value

string

WebsiteChannelNames

The web site channels this route is registered for.

public string[] WebsiteChannelNames { get; set; }

Property Value

string[]

Remarks

When set, the route is registered only for the specified website channels. When empty, the route is registered for all website channels.

Methods

PreInit()

Registers the page route during application pre-initialization.

public void PreInit()