RadAjax for ASP.NET AJAX

RadControls for ASP.NET AJAX

Usually the HTML elements have more client-side events than their server-side counterparts. For example the asp:TextBox control implements only the TextChanged server-side event while the corresponding HTML element has a few more: OnMouseOver, OnMouseOut, OnKeyPress, OnKeyUp, OnKeyDown, etc. If you want to ajaxify one of these client events you have to follow the instructions bellow:

Method I (add the attribute declaratively)

  1. Add the OnKeyUp attribute and make it call a custom function:

CopyASPX
<asp:TextBox onkeyup="TextBoxCustomAjax('TextBox1');" ID="TextBox1" runat="server">
</asp:TextBox>

2. Implement the TextBoxCustomAjax function:

CopyJavaScript
function TextBoxCustomAjax(eventArgs) {
    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(eventArgs);
}
  1. Implement the AjaxRequest server event of the AjaxManager:

  2. Set from the designer that the RadAjaxManager1 will update Label1.

Method II (add the attribute from code-behind).

  1. Add the OnKeyUp attribute:

2. Implement the AjaxRequest event of the RadAjaxManager:

3. Set from the design-time configuration wizard that RadAjaxManager1 will update Label1.