SessionStateModule.Init Method (HttpApplication)

 

Calls initialization code when a SessionStateModule object is created.

Namespace:   System.Web.SessionState
Assembly:  System.Web (in System.Web.dll)

public void Init(
	HttpApplication app
)

Parameters

app
Type: System.Web.HttpApplication

The current application.

Exception Condition
HttpException

The mode attribute in the sessionState Element (ASP.NET Settings Schema) configuration element is set to StateServer or SQLServer, and the ASP.NET application has less than Medium trust.

ConfigurationErrorsException

The mode attribute in the sessionState Element (ASP.NET Settings Schema) configuration element is set to Custom and the customProvider attribute is empty or does not exist.

-or-

The mode attribute in the sessionState Element (ASP.NET Settings Schema) configuration element is set to Custom and the provider identified by name in the customProvider attribute has not been added to the providers Element for sessionState (ASP.NET Settings Schema) sub-element.

This method is not intended to be called from application code.

An HttpApplication is created when an ASP.NET application is started. The HttpApplication object calls the Init method when it creates the SessionStateModule object for the application. The SessionStateModule class is specified in the configuration for an application.

.NET Framework
Available since 1.1
Return to top
Show: