System.Web.UI.WebControls.LinkButton.OnClick Method

Raises the LinkButton.Click event of the System.Web.UI.WebControls.LinkButton control.

Syntax

protected virtual void OnClick (EventArgs e)

Parameters

e
A EventArgs that contains the event data.

Remarks

The LinkButton.Click event is raised when the System.Web.UI.WebControls.LinkButton control is clicked. This event is commonly used when no command name is associated with the System.Web.UI.WebControls.LinkButton control, as in the case of a Submit button.

Raising an event invokes the event handler through a delegate. For more information, see [<topic://cpconProvidingEventFunctionality>].

The LinkButton.OnClick(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