Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Class RewritePipe

Exposes events that are fired during HTML parsing.

Inheritance
System.Object
RewritePipe
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.Web
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class RewritePipe

Constructors

RewritePipe()

Declaration
public RewritePipe()

Properties

Encoding

Gets the encoding.

Declaration
public Encoding Encoding { get; protected set; }
Property Value
Type Description
System.Text.Encoding

The encoding.

Methods

OnHtmlInit(HtmlRewriteEventArgs)

Raises the HtmlInit event.

Declaration
protected virtual void OnHtmlInit(HtmlRewriteEventArgs e)
Parameters
Type Name Description
HtmlRewriteEventArgs e

The HtmlRewriteEventArgs instance containing the event data.

OnHtmlRewriteBegin(HtmlRewriteEventArgs)

Raises the HtmlRewriteBegin event.

Declaration
protected virtual void OnHtmlRewriteBegin(HtmlRewriteEventArgs e)
Parameters
Type Name Description
HtmlRewriteEventArgs e

The HtmlRewriteEventArgs instance containing the event data.

OnHtmlRewriteEnd(HtmlRewriteEventArgs)

Raises the HtmlRewriteEnd event.

Declaration
protected virtual void OnHtmlRewriteEnd(HtmlRewriteEventArgs e)
Parameters
Type Name Description
HtmlRewriteEventArgs e

The HtmlRewriteEventArgs instance containing the event data.

OnHtmlRewriteName(HtmlRewriteEventArgs)

Raises the HtmlRewriteName event.

Declaration
protected virtual void OnHtmlRewriteName(HtmlRewriteEventArgs e)
Parameters
Type Name Description
HtmlRewriteEventArgs e

The HtmlRewriteEventArgs instance containing the event data.

OnHtmlRewriteUrl(HtmlRewriteEventArgs)

Raises the HtmlRewriteUrl event.

Declaration
protected virtual void OnHtmlRewriteUrl(HtmlRewriteEventArgs e)
Parameters
Type Name Description
HtmlRewriteEventArgs e

The HtmlRewriteEventArgs instance containing the event data.

OnHtmlRewriteValue(HtmlRewriteEventArgs)

Raises the HtmlRewriteValue event.

Declaration
protected virtual void OnHtmlRewriteValue(HtmlRewriteEventArgs e)
Parameters
Type Name Description
HtmlRewriteEventArgs e

The HtmlRewriteEventArgs instance containing the event data.

Events

HtmlInit

Raised once at the start, for every instantiation of us.

Declaration
public event EventHandler<HtmlRewriteEventArgs> HtmlInit
Event Type
Type Description
System.EventHandler<HtmlRewriteEventArgs>

HtmlRewriteBegin

Raised at the start of the HTML stream, before anything has been parsed or output. Subscribers may take this chance to initialize, do other tings before the actual parsing begins.

Declaration
public event EventHandler<HtmlRewriteEventArgs> HtmlRewriteBegin
Event Type
Type Description
System.EventHandler<HtmlRewriteEventArgs>

HtmlRewriteEnd

Raised when all HTML has been parsed, just before flushing

Declaration
public event EventHandler<HtmlRewriteEventArgs> HtmlRewriteEnd
Event Type
Type Description
System.EventHandler<HtmlRewriteEventArgs>

HtmlRewriteName

Raised when a an element or attribute name has been found. Subscribers may change the name, or do other things as a result of this event. This event together with HtmlRewriteValue is the most common event to subscribe to.

Declaration
public event EventHandler<HtmlRewriteEventArgs> HtmlRewriteName
Event Type
Type Description
System.EventHandler<HtmlRewriteEventArgs>

HtmlRewriteUrl

Give subscribers a chance to modify an URL

Declaration
public event EventHandler<HtmlRewriteEventArgs> HtmlRewriteUrl
Event Type
Type Description
System.EventHandler<HtmlRewriteEventArgs>

HtmlRewriteValue

Raised when a value has been found, such as an attribute value, but also when the text contents of an element is found, whitespace or any other item that has text. This event togheter with HtmlRewrietName is the most common event to subscribe to. Set IsHoldingOutput = true to suppress output of the value, modified or not.

Declaration
public event EventHandler<HtmlRewriteEventArgs> HtmlRewriteValue
Event Type
Type Description
System.EventHandler<HtmlRewriteEventArgs>

Extension Methods