November Happy Hour will be moved to Thursday December 5th.

Class VirtualPathDataExtensions

Contains extension methods that are useful when working with Microsoft.AspNetCore.Routing.VirtualPathData.

Inheritance
System.Object
VirtualPathDataExtensions
Namespace: EPiServer.Web.Routing
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3
Syntax
public static class VirtualPathDataExtensions : Object

Methods

GetUrl(VirtualPathData)

Returns a URL from the routing information stored in the virtual path data.

Declaration
public static string GetUrl(this VirtualPathData virtualPathData)
Parameters
Type Name Description
Microsoft.AspNetCore.Routing.VirtualPathData virtualPathData

The VirtualPathData instance this method extends.

Returns
Type Description
System.String

A string containing the URL.

Remarks

You should use this method instead of the Microsoft.AspNetCore.Routing.VirtualPathData.VirtualPath property as it will take multiple site configuration (CMS enterprise sites) into consideration.

GetUrl(VirtualPathData, Boolean)

Returns a URL from the routing information stored in the virtual path data.

Declaration
public static string GetUrl(this VirtualPathData virtualPathData, bool multiSiteSupport)
Parameters
Type Name Description
Microsoft.AspNetCore.Routing.VirtualPathData virtualPathData

The VirtualPathData instance this method extends.

System.Boolean multiSiteSupport

If value is true then will the host for the site be added in case the virtual path is to another site than current http request (or if no http context is available).

Returns
Type Description
System.String

A string containing the relative path.