System.Web.UI.HtmlControls.HtmlInputRadioButton.OnServerChange Method

Raises the HtmlInputRadioButton.ServerChange event. This allows you to create a custom event handler when the event is raised.

Syntax

protected virtual void OnServerChange (EventArgs e)

Parameters

e
A EventArgs that contains the event data.

Remarks

The HtmlInputRadioButton.ServerChange event is raised when the HtmlInputRadioButton.Checked property of the System.Web.UI.HtmlControls.HtmlInputRadioButton control changes values between posts to the server. This allows you to create a custom event handler that performs a specific set of instructions (such as data validation) when the event is raised.

Note:

The control must have view state enabled for the HtmlInputRadioButton.ServerChange event to work correctly. To enable view state for all controls on the Web Forms page, set the System.Web.UI.Page.EnableViewState property to true. You can also enable view state for an individual control by setting the System.Web.UI.Control.EnableViewState property to true.

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The HtmlInputRadioButton.OnServerChange(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.HtmlControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0