The OnClientResponseError occurs in the cases when an error (WebService or Callback error) occurs when the RadXmlHttpPanel tries to load certain content.

The event handler receives two parameters:

  1. The instance of the RadXmlHttpPanel control in which the error occurred.

  2. An eventArgs parameter containing the following properties and methods:

    1. set_cancelErrorAlert lets you prevent from displaying the built-in error alert that notifies the user that an error has occurred, and gives the possibility to display a custom error message.

    2. get_cancelErrorAlert returns a boolean value indicating whether the RadXmlHttpPanel’s displaying of the built-in error alert has been canceled.

The following example demonstrates how the user can display: a custom content inside the RadXmlHttpPanel or a custom error message (alert), if an error has occurred while loading content inside the panel. The panel tries to load RadCalendar control, but an error will occur because the control’s RegisterWithScriptManager property has not been set to false.

function LoadCalendar()
    var panel = $find("RadXmlHttpPanel1");
function OnClientResponseError(panel, args)
    alert("OnClientResponseError fired because an error occured");
    var content = "<label style='color: Red;'>The Control could not be loaded because of an callback error!</label>";
<input type="button" value="LoadRadCalendar" onclick="LoadCalendar()" />
<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="RadXmlHttpPanel1_ServiceRequest" OnClientResponseError="OnClientResponseError">
protected void RadXmlHttpPanel1_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
    RadCalendar calendar = new RadCalendar();
    calendar.ID = "RadCalendar1";
    //calendar.RegisterWithScriptManager = false
Protected Sub RadXmlHttpPanel1_ServiceRequest(ByVal sender As Object, ByVal e As RadXmlHttpPanelEventArgs)
    Dim calendar As New RadCalendar()
    calendar.ID = "RadCalendar1"
    'calendar.RegisterWithScriptManager = false
End Sub
In this article
Not finding the help you need? Improve this article