RadControls for ASP.NET AJAX
|Visual Studio version
all browsers supported by RadControls
When using Forms Authentication, triggering the AjaxUpdate event of the RadToolTipManager after the session expires, leads to "Sys.WebForms.PageRequestManagerServerErrorException" error. The problem lies in the MS AJAX architecture
, and goes in direct conflict with Forms Authentication, because the Forms Authentication relies on redirecting to a new page, while UpdatePanels are designed to do partial page updates and "expect" to receive partial HTML.
The solution demonstrated in this code library uses a WebService to check whether the Session has expired, before the RadToolTip shows and triggers the callback that is to fetch its content from the server. Steps to follow:
- Create a web service with the [ScriptService] attribute.
- Define an IsLoggedIn method that checks whether the user is still logged in.
- Add a ServiceReference within the ScriptManager (RadScriptManager) pointing to the web service.
- In the OnClientBeforeShow event of the RadToolTipManager, invoke the IsLoggedIn web method - in case the user is not logged in, reload the entire page.
- Add in the web.config file an AJAX HTTP Handler for .asmx files.