RadAjax for ASP.NET AJAX

RadControls for ASP.NET AJAX

The OnRequestStart client-side event handler is called when a request to the server is started. The event can be initially triggered by an initiating control configured in RadAjaxManager settings, a control within a RadAjaxPanel or by a client-side ajaxRequest() call. The event can be canceled.

Two parameters are passed to the event handler with the following methods:

  • sender - the instance of the client-side RadAjaxManager/RadAjaxPanel object.

  • eventArgs has the following methods:

    • set_cancel() lets you permit or block the AJAX request from continuing. Calling set_cancel(true) prevents the request from continuing.

    • get_eventTarget() gets the UniqueID of the element that had raised the request.

    • get_eventArgument() gets the string passed in the initial AJAX request.

    • get_eventTargetElement() gets the instance of the client-side object that raised the AJAX request. You can iterate each of the settings and retrieve the initiating control id andyet another array of objects that represent updated controls.

    • get_ajaxSettings() returns an array of objects that represents RadAjaxManager's current configuration/RadAjaxPanel's updated controls

    • get_enableAjax(), set_enableAjax() - gets or sets if an AJAX request is performed. set_enableAjax(false) causes the request to be performed via standard postback.

The following example uses displays the control that initiated the request.

CopyASPX
<script type="text/javascript">
    function requestStart(sender, eventArgs) {
        alert('Request start initiated by: ' + eventArgs.get_eventTarget());
    }
</script>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <ClientEvents OnRequestStart="requestStart" />
</telerik:RadAjaxManager>

See Also

Other Resources