Raises the LoggingIn event when a user submits login information but before the authentication takes place.
Assembly: System.Web (in System.Web.dll)
Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.Notes to Inheritors
When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event.
The following code example uses the LoggingIn event to ensure that the user has entered a well-formed e-mail address in the UserName property. If not, the LoggingIn event handler cancels the login attempt and displays the error message specified in the InstructionText property.
The following code example demonstrates how you can extend the Login control. The CustomLogin control includes a DropDownList control that lets users choose which membership provider they are authenticated with. (These providers are configured in Web.config.) In the method, the MembershipProvider property is set to the selected value of the DropDownList control.
This example contains a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.