Hi,
I am having an asp ajax update panel and rad loading panel. I am using the below code to show the loading panel during ajax requests. I have a timer which keeps polling a DB for a specific interval.
Situation:
If the page is inactive for a long time, the session expires, but the timer is still polling the DB. Due to the session expiry or due to some error from the server, a script error is thrown. How do i handle this in the below code?
I am having an asp ajax update panel and rad loading panel. I am using the below code to show the loading panel during ajax requests. I have a timer which keeps polling a DB for a specific interval.
Situation:
If the page is inactive for a long time, the session expires, but the timer is still polling the DB. Due to the session expiry or due to some error from the server, a script error is thrown. How do i handle this in the below code?
| <script> |
| var loadingPanel = ""; |
| var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); |
| var postBackElement = ""; |
| pageRequestManager.add_initializeRequest(initializeRequest); |
| pageRequestManager.add_endRequest(endRequest); |
| function initializeRequest(sender, eventArgs) { |
| loadingPanel = $find('<% = RadAjaxLoadingPanel1.ClientID %>'); |
| postBackElement = eventArgs.get_postBackElement().id; |
| loadingPanel.show(postBackElement); |
| } |
| } |
| function endRequest(sender, eventArgs) { |
| loadingPanel = $find('<% = RadAjaxLoadingPanel1.ClientID %>'); |
| loadingPanel.hide(postBackElement); |
| } |
| </script> |