• .NET Mobile

    Migrating OnClientClick handlers from ASP button to Telerik’s ASP.NET AJAX Button

    Let’s start with some background – a common need is for a button to execute some JavaScript code in order to create a more responsive page. With the standard ASP:Button the OnClientClick is used to specify this execution statement. Take the following simple example: <script type="text/javascript">     function ButtonClick(button) {         alert("The Button with ID " + button.id + " was clicked.");     } </script> <asp:Button ID="Button1" Text="Regular Button" OnClientClick="ButtonClick(this); return false;" runat="server" />   What you can see here is a function called with parentheses, an argument provided to the function and the return false; statement that prevents the postback. The case with Telerik’s ASP.NET AJAX Button is slightly different, however. It follows the convention all other Telerik ASP.NET AJAX...