This documentation is archived and is not being maintained.

LoginCancelEventArgs::Cancel Property

Gets or sets a value indicating whether the event should be canceled.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property bool Cancel {
	bool get ();
	void set (bool value);
}

Property Value

Type: System::Boolean
true if the event should be canceled; otherwise, false.

You can use the Cancel property to indicate whether an event, such as the LoggingIn event, the LoggingOut event, or the ChangingPassword event, should be canceled.

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 sets the Cancel property to true, and an error message is displayed. For an .aspx file that can be used to run the example, see the LoginCancelEventArgs topic.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

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.
Show: