RadAjax for ASP.NET AJAX

RadControls for ASP.NET AJAX

Client-side events for RadAjaxManager/RadAjaxPanel

RadAjaxManager and RadAjaxPanel both descend from RadAjaxControl. RadAjaxControl introduces the AjaxClientEvents property that contains the following events:

  • OnRequestStart - This event is fired when a request to the server is started.

  • OnResponseEnd - This event is fired when a response from the server is processed.

To use these events, simply write a javascript function that can be called when the event occurs. Then assign the name of the javascript function as the value of the the corresponding property.

CopyASPX
<script type="text/javascript">
    function requestStart(sender, eventArgs) {
        alert('Request start');
    }
    function responseEnd(sender, eventArgs) {
        alert('Response complete');
    }
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <ClientEvents OnRequestStart="requestStart" OnResponseEnd="responseEnd" />
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Button1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="TextBox1"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

RadAjaxLoadingPanel contains the following client events:

To use these events, simply write a javascript function that can be called when the event occurs. Then assign the name of the javascript function as the value of the the corresponding property.

CopyASPX
<script type="text/javascript">
    function MyClientShowing(sender, eventArgs) {
        eventArgs.get_loadingElement().style.border = "2px solid red";
        eventArgs.set_cancelNativeDisplay(true);
        $telerik.$(eventArgs.get_loadingElement()).show("slow");
    }
    function MyClientHiding(sender, eventArgs) {
        eventArgs.get_loadingElement().style.border = "2px solid blue";
        eventArgs.set_cancelNativeDisplay(true);
        $telerik.$(eventArgs.get_loadingElement()).hide("slow");
    }
</script>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackColor="yellow"
    OnClientShowing="MyClientShowing" OnClientHiding="MyClientHiding" />