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

Class SiteBase

Base class for site-specific overrideable methods that control site behavior via HttpApplication pipe-line events. This class is included in the EPiServer SDK to serve as a basis for adapted implementations where a different behavior is required. Override in Global.asax.cs as required.

Inheritance
System.Object
SiteBase
Namespace: EPiServer
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class SiteBase : HttpApplication

Constructors

SiteBase()

Declaration
public SiteBase()

Properties

IsDefaultDocumentsEnabled

Gets or sets a value indicating whether this instance has default documents enabled.

Declaration
public bool IsDefaultDocumentsEnabled { get; set; }
Property Value
Type Description
System.Boolean

true if this instance has default documents enabled; otherwise, false.

Methods

GetDefaultDocuments(Uri)

Gets a list of default documents. Override if you need to change which documents are actually tried.

Declaration
protected virtual string[] GetDefaultDocuments(Uri url)
Parameters
Type Name Description
System.Uri url

The URL of the request that is determined to need a default document

Returns
Type Description
System.String[]

null or a list of default documents to try

Remarks

Set HttpContext.Current.Items[ENABLE_DEFAULT_DOCUMENTS] = false; to disable default default document handling.

OnValidateRequestAccess(ValidateRequestAccessEventArgs)

Raises the ValidateRequestAccess event.

Declaration
protected virtual void OnValidateRequestAccess(ValidateRequestAccessEventArgs e)
Parameters
Type Name Description
ValidateRequestAccessEventArgs e

The ValidateRequestAccessEventArgs instance containing the event data.

SchemeHostPortMatch(Uri, Uri)

Checks if the scheme, host and port matches between two URI:s.

Declaration
protected virtual bool SchemeHostPortMatch(Uri url1, Uri url2)
Parameters
Type Name Description
System.Uri url1

The URL to compare.

System.Uri url2

The URL to compare against.

Returns
Type Description
System.Boolean

true if they match

Events

ValidateRequestAccess

Attach an event-handler to this event to be able to cancel an access to a resource located in a system directory with an access denied message.

Declaration
public static event EventHandler<ValidateRequestAccessEventArgs> ValidateRequestAccess
Event Type
Type Description
System.EventHandler<ValidateRequestAccessEventArgs>

Extension Methods