Edit this page

Events Overview

The RadPushButton exposes several client-side events which allow easy and flexible use in a wide range of application scenarios:

To handle the desired event, the user must set the respective property to the name of the JavaScript function handling the event or to anonymous JavaScript function. Here is an example:

Example 1: Passing named (non-anonymous) JavaScript function.

<script type="text/javascript">
    function Click(sender, args)
    {
        alert("RadPushButton was clicked.");
    }
</script>
<telerik:RadPushButton ID="RadPushButton1" runat="server" OnClientClicked="Click">
</telerik:RadPushButton>
RadPushButton1.OnClientClicked = "Click";  //passing the name of the JS function
RadPushButton1.OnClientClicked = "Click"  'passing the name of the JS function

Example 2: Passing anonymous JavaScript function.

<script type="text/javascript">
    function Click(button, args, arg1, arg2)
    {
        alert("arg1:" + arg1 + " arg2:" + arg2);
    }
</script>

<telerik:RadPushButton ID="RadPushButton1" runat="server" OnClientClicked="function(sender,args){Click(sender, args, 'Value1', 'Value2');}">
</telerik:RadPushButton>
RadPushButton1.OnClientClicked = "function(sender,args){Click(sender, args, 'Value1', 'Value2');}"; //passing the name of the JS function
RadPushButton1.OnClientClicked = "function(sender,args){Click(sender, args, 'Value1', 'Value2');}"  'passing the name of the JS function

See Also

Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy