System.Web.UI.WebControls.CheckBox.OnCheckedChanged Method

Raises the CheckBox.CheckedChanged event of the System.Web.UI.WebControls.CheckBox control. This allows you to handle the event directly.

Syntax

protected virtual void OnCheckedChanged (EventArgs e)

Parameters

e
A EventArgs that contains the event data.

Remarks

The CheckBox.CheckedChanged event is raised when the value of the CheckBox.Checked property changes between posts to the server.

Note:

A System.Web.UI.WebControls.CheckBox control must persist some values between posts to the server for this event to work correctly. Be sure that view state is enabled for this control.

Raising an event invokes the event handler through a delegate. For more information, see How to: Consume Events in a Web Forms Application

The CheckBox.OnCheckedChanged(EventArgs) 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.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0