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 */
public boolean get_Cancel ()

/** @property */
public void set_Cancel (boolean value)

public function get Cancel () : boolean

public function set Cancel (value : boolean)

Not applicable.

Property Value

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.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: