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

Session Timeout Notification & Modal Window

3 Answers 324 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 2
Nathan asked on 16 Nov 2011, 12:04 AM
Hello,

I'm using a notification control to alert the users when the page is close to timing out. This works great, but when I open a page that displays a large modal window it doesn't seem to work. Should I try to get the notification control to appear over the modal window or add another notification control to the modal window?

If I use another notification control for the modal window, will it reset the counter on the parent window?

I've setup the session timeout notification control following the demo as an example:
http://demos.telerik.com/aspnet-ajax/notification/examples/sessiontimeout/defaultcs.aspx


Thanks,
Nathan

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 16 Nov 2011, 01:17 PM
Hi Nathan,

Are you referring to a large modal RadWindow or a large modal browser window? I am asking this because there is a fundamental difference between both:

- the RadWindow is a control from the same page, so you can control the positioning of the elements via their z-index values as shown in this help article: http://www.telerik.com/help/aspnet-ajax/controlling-absolute-positioning-with-zindex.html. Also, this means that the end user is still in the context of the page where the RadNotification resides, so this should eliminate further issues with the display. If the RadWindow is maximized it gets a very big z-index (i.e. 100000) and this can be disabled by setting its ShowOnTopWhenMaximized property to false.

- the browser window is a separate program, so ti is difficult to access it via JavaScript. You can only do so if it is opened from the page where the RadNotification is and you have kept a reference to it. It is also not possible to force the notification above it, since you cannot take a control out of the context of its browser. What you can do in this case is to enable the sound for the RadNotification so that the user can at least hear it. Activity in the second window would not reset the JavaScript timer of the notification so if you need to extend the session you would need to call the appropriate function from the first window (i.e. from the modal one something like window.opener.ContinueSession() should be called).


Best wishes,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Nathan
Top achievements
Rank 2
answered on 16 Nov 2011, 07:35 PM
Hello,

I was referring to a regular modal window, not RadWindow. I'm trying to determine the best approach for session timeout control when presented with a modal dialog. Is it better to use a notification control on both the parent and modal or only have one notification control on the parent.

Do you recommend using one notification control from the parent window? This would work as you suggested using a sound as well as updating using javascript during the modal activity. So I can call the parent's ContinueSession() using "window.opener" when the user clicks a link in the modal that causes a request to the server - correct? Would the "resetTimer()" function be better for this?

Please let me know if have a notification in both parent/modal would be a better solution - or one notification in the parent in which the modal can access.

Thanks,
Nathan

0
Marin Bratanov
Telerik team
answered on 17 Nov 2011, 04:58 PM
Hi Nathan,

Having another notification in the modal window would make it difficult to synchronize the timers, so I suggest you simply renew the session via JavaScript in the main window when opening the second. This can be done either in the pageLoad event of the child window as explained in my previous reply, or by attaching clien-side handlers to links, buttons and other elements that open a page from the same server thus renew the session internally without the notification being otherwise informed of this. The correct function to call is ContinueSession() as it hides the notification, resets the timers, etc.


All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Notification
Asked by
Nathan
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Nathan
Top achievements
Rank 2
Share this question
or