This is a migrated thread and some comments may be shown as answers.

XMLHttp Panel post fails with 404...app_offline trick

1 Answer 60 Views
XmlHttpPanel
This is a migrated thread and some comments may be shown as answers.
Doug Swanson
Top achievements
Rank 1
Doug Swanson asked on 25 Jun 2010, 09:15 PM
I have a telerik radgrid inside of an xmlhttp panel that I refresh at a given interval with the following javascript...
function startWorklistRefresh() {
                if (wlIntervalId == 0) {
                    wlIntervalId = setInterval("reloadWorklist();", wlCtrlAutoRefreshRate);
                }
            }
            function reloadWorklist() {
                $find("<%= XmlGridPanel.ClientID %>").set_value("Reload");
            }
function OnClientResponseError(panel,args){
    alert('wtf');
}

We update our site using the app_offline.htm trick for IIS. The problem is that I can see (via FF/Firebug) the reloadworklist happening but there are 404 errors happening (as expected) when I take the site offline...but the user is does not see our app_offline page..I tried adding a clientside event for OnClientResponseError but that event was never hit...what I would like to have is a hook so I can redirect the user to some default.aspx page...I also tried the custom errors web.config but apparently that doesn't take effect for an xmlhttppanel request...any help would be greatly appreciated.

thanks
ds


1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 30 Jun 2010, 12:02 PM
Hello Doug,

The XmlHttpPanel uses ASP.NET Callback mechanism to update its content. How the XmlHttpPanel will behave in such scenario (when app_offline.html is present in the root directory) will entirely depend on the ASP.NET Callback mechanism. The callback is initiated using the WebForm_DoCallback method, which takes as an argument the javascript method that will be invoked if an error occurs. Basically, if an error occurs you will be able to handle the OnClientResponseError client-side event of the XmlHttpPanel, but an error is not thrown and the event is not fired.
I tried several approaches to track whether the application is offline, in the code behind, but to no avail.
Here is what I tried:
protected void XmlPanel1_ServiceRequest(object sender, Telerik.Web.UI.RadXmlHttpPanelEventArgs e)
{
    Response.StatusCode = 404;
     
    if (Response.StatusCode != 200)
    {
        throw new Exception("Application Offline!");
    }
}

I will continue investigating the issue, and if anything comes up I will follow-up in this thread. If you find a solution, could you please share it with us? I am sure it will be of help to other members of the community.

Best wishes,
Pero
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
XmlHttpPanel
Asked by
Doug Swanson
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or