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

Class UrlSegmentGeneratorExtensions

Extends IUrlSegmentGenerator with convenient methods.

Inheritance
System.Object
UrlSegmentGeneratorExtensions
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public static class UrlSegmentGeneratorExtensions : Object

Methods

Create(IUrlSegmentGenerator, String)

Creates a url friendly segment from the passed in string

Declaration
public static string Create(this IUrlSegmentGenerator urlSegmentGenerator, string proposedSegment)
Parameters
Type Name Description
IUrlSegmentGenerator urlSegmentGenerator

The url segment generator that is extended

System.String proposedSegment

The segment to generate a url friendly segment for

Returns
Type Description
System.String

A url friendly segment

Remarks

The default registered instance of UrlSegmentOptions is used where ValidCharacters specifies which characthers that are considered valid. CharacterMap specifies which character replacements.

IsValid(IUrlSegmentGenerator, String)

Determines if an url segment is considered url friendly

Declaration
public static bool IsValid(this IUrlSegmentGenerator urlSegmentGenerator, string segment)
Parameters
Type Name Description
IUrlSegmentGenerator urlSegmentGenerator

The url segment generator that is extended

System.String segment

The segment to validate

Returns
Type Description
System.Boolean

true if segment is considered valid else false

Remarks

The default registered instance of UrlSegmentOptions is used where ValidCharacters specifies which characthers that are considered valid.