Table of Contents

Class UrlHelperPreviewExtensions

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

Provides extension methods for the UrlHelperExtensionPoint.

public static class UrlHelperPreviewExtensions
Inheritance
object
UrlHelperPreviewExtensions

Methods

ApplyPreviewContext(UrlHelperExtensionPoint, string)

Extends the given url by information about the current website channel and preview mode when used within the Kentico Xperience administration UI (Page builder, Page preview).

public static string ApplyPreviewContext(this UrlHelperExtensionPoint instance, string url)

Parameters

instance UrlHelperExtensionPoint

The object that provides methods to build URLs to Kentico content.

url string

URL that is to be extended. The following URL formats will be extended: Relative (virtual) or absolute path.

Returns

string

The url extended by the preview information when used within the Kentico Xperience administration UI, otherwise the original url.

Remarks

Use this method within your MVC site codebase only. It is not intended for use in UI components and UI pages of the Kentico Xperience administration UI.

Exceptions

ArgumentNullException

instance is null.

ArgumentException

url is null or empty.