LoginCancelEventArgs Class
Provides data for a cancelable event.
System::EventArgs
System.Web.UI.WebControls::LoginCancelEventArgs
System.Web.UI.WebControls::MailMessageEventArgs
Assembly: System.Web (in System.Web.dll)
The LoginCancelEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | LoginCancelEventArgs() | Initializes a new instance of the LoginCancelEventArgs class with the Cancel property set to false. |
![]() | LoginCancelEventArgs(Boolean) | Initializes a new instance of the LoginCancelEventArgs class with the Cancel property set to the specified value. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
A cancelable event is raised when a component is about to perform an action that can be canceled, such as logging on to a Web site.
The LoginCancelEventArgs class provides the Cancel property to indicate whether the event should be canceled. A LoginCancelEventArgs object is used with controls that have cancelable actions, such as the Login control, the CreateUserWizard control, and the PasswordRecovery control.
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 logon attempt by setting the Cancel property of the LoginCancelEventArgs object to true.Then the error message specified in the InstructionText property is displayed.
The following is the .aspx file that can be used to run the preceding example.
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.


