Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP.NET Button OnClientClick Property

ASP.NET Button OnClientClick Property


Button Control Button Control


Definition and Usage

The OnClientClick property is used to set a client-side script that runs when the Button control is clicked.

In addition to predefined scripts, the script specified in this property runs through the button's "OnClick" event.

Syntax

/>

property Description
OnClientClick The client-side script that runs when the button is clicked.

Example

Example

The following example runs two scripts when the Button control is clicked:

Text="Click Me" runat="server" />


Demo Example »


Button Control Button Control