System.Web.Security.FormsAuthenticationEventHandler Delegate

Represents the method that handles the FormsAuthentication_OnAuthenticate event of a System.Web.Security.FormsAuthenticationModule.

Syntax

public delegate void FormsAuthenticationEventHandler (object sender, FormsAuthenticationEventArgs e)

Parameters

sender
Documentation for this section has not yet been entered.
e
Documentation for this section has not yet been entered.

Remarks

The System.Web.Security.FormsAuthenticationEventHandler delegate is defined for the FormsAuthenticationModule.Authenticate event of the System.Web.Security.FormsAuthenticationModule class. You can access the FormsAuthenticationModule.Authenticate event of the System.Web.Security.FormsAuthenticationModule class by specifying a subroutine named FormsAuthentication_OnAuthenticate in the Global.asax file for your ASP.NET application. The FormsAuthenticationModule.Authenticate event is raised during the System.Web.HttpApplication.AuthenticateRequest event.

The System.Web.Security.FormsAuthenticationModule constructs a System.Web.Security.FormsAuthenticationEventArgs object using the current System.Web.HttpContext and passes it to the FormsAuthentication_OnAuthenticate event.

You can use the FormsAuthenticationEventArgs.User property of the System.Web.Security.FormsAuthenticationEventArgs object supplied to the FormsAuthentication_OnAuthenticate event to set the System.Web.HttpContext.User property of the current System.Web.HttpContext to a custom System.Security.Principal.IPrincipal object. If you do not specify a value for the FormsAuthenticationEventArgs.User property during the FormsAuthentication_OnAuthenticate event, the identity supplied by the forms authentication ticket in the cookie or URL is used.

The FormsAuthentication_OnAuthenticate event is only raised when the authentication System.Web.Configuration.AuthenticationSection.Mode is set to System.Web.Configuration.AuthenticationMode.Forms and the System.Web.Security.FormsAuthenticationModule is an active HTTP module for the application.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0