Hi,
Can someone please tell me what is the best way to handle errors on a page displayed within a RadWindow? I would like to handle the Page.Error event, but for some reason, this doesn't seem to fire when my page is displayed in a RadWindow. I have also tried handle the ScriptManager.AsyncPostBackError event but it also doesn't seem to fire. I can get the Application_Error to fire in Global.asax, but I can't get a reference to the Page to properly handle my errors from there.
What I am trying to acheive is to have my error handler catch all AuthenticationExceptions and redirect to the login page. However, if the page is actually a RadWindow, I don't want to redirect the RadWindow to the login page, I actually want to redirect the parent page to the login window. I tried to use the Context.Handler from within Application_Error to determine the type of the page that caused the error, but this is null when the error is raised by a RadWindow, so I have no way to get a reference to the parent window to redirect it. My solution was instead to have all pages that open in a RadWindow use a given MasterPage, and then handle the Page.Error event within the MasterPage, but unfortunately, this doesn't fire. So I tried to handle it directly within the Page, but Page.Error doesn't seem to fire either. Next I tried ScriptManager.AsyncPostBackError, but had no luck. In every case, I manually listened to the event using eg. Page.Error += Page_Error;
Any suggestions?
Thanks,
Billy
Can someone please tell me what is the best way to handle errors on a page displayed within a RadWindow? I would like to handle the Page.Error event, but for some reason, this doesn't seem to fire when my page is displayed in a RadWindow. I have also tried handle the ScriptManager.AsyncPostBackError event but it also doesn't seem to fire. I can get the Application_Error to fire in Global.asax, but I can't get a reference to the Page to properly handle my errors from there.
What I am trying to acheive is to have my error handler catch all AuthenticationExceptions and redirect to the login page. However, if the page is actually a RadWindow, I don't want to redirect the RadWindow to the login page, I actually want to redirect the parent page to the login window. I tried to use the Context.Handler from within Application_Error to determine the type of the page that caused the error, but this is null when the error is raised by a RadWindow, so I have no way to get a reference to the parent window to redirect it. My solution was instead to have all pages that open in a RadWindow use a given MasterPage, and then handle the Page.Error event within the MasterPage, but unfortunately, this doesn't fire. So I tried to handle it directly within the Page, but Page.Error doesn't seem to fire either. Next I tried ScriptManager.AsyncPostBackError, but had no luck. In every case, I manually listened to the event using eg. Page.Error += Page_Error;
Any suggestions?
Thanks,
Billy