Adds an event handler for the OnServerClick event.
[Visual Basic] Overridable Public Sub AddOnServerClick( _ ByVal value As EventHandler _ ) [C#] public virtual void AddOnServerClick( EventHandler value ); [C++] public: virtual void AddOnServerClick( EventHandler* value ); [JScript] public function AddOnServerClick( value : EventHandler );
The OnServerClick event is raised on the server when a client clicks a input server control button. This server event does cause a round-trip to occur from the client. It accomplishes this by emitting a custom client-side javascript call to the Web Forms provided ?doPostBack()? framework method.
This server control will raise an exception at runtime if the user attempts to wireup an OnServerClick handler, and the button control is not nested within a server form control.
Note The server-side OnServerClick event is deliberately different from the client-side OnClick event. In the event that a conflict exists between code run with OnServerClick event and code run by a client-side OnClick event, the server side event instructions will override the client-side code.
HtmlInputButton Class | HtmlInputButton Members | System.Web.UI.HtmlControls Namespace