Class UrlBuilderExtensions

Extends UrlBuilder

Inheritance
System.Object
UrlBuilderExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public static class UrlBuilderExtensions

Methods

MakeRelative(UrlBuilder, String, String)

Make a root-relative path relative another root-relative path

Declaration
[Obsolete("Functionality have been moved into the URL rewrite provider")]
public static string MakeRelative(this UrlBuilder urlBuilder, string fromBase, string path)
Parameters
Type Name Description
UrlBuilder urlBuilder

url builder that is extended

System.String fromBase

From base.

System.String path

The path.

Returns
Type Description
System.String

If possible, a shorter, relative path

Remarks

The reason for not using VirtualPathUtility.MakeRelative is because it is very slow, and we can make some rather safe assumptions here which speeds things up significantly.

Rebase(UrlBuilder, UrlBuilder, UrlBuilder, RebaseKind)

Rebases this instance assuming it is valid relative the fromBaseUrl to be valid relative toBaseUrl.

Declaration
[Obsolete("Functionality have been moved into the URL rewrite provider")]
public static bool Rebase(this UrlBuilder urlBuilder, UrlBuilder fromBaseUrl, UrlBuilder toBaseUrl, RebaseKind kind)
Parameters
Type Name Description
UrlBuilder urlBuilder

The urlBuilder that is extended

UrlBuilder fromBaseUrl

From base URL.

UrlBuilder toBaseUrl

To base URL.

RebaseKind kind

The form of the result.

Returns
Type Description
System.Boolean