views:

302

answers:

3

Hello everyone,

I have a scenario where I would like to display a message to the users of my application alerting them that his session will expire soon and that he should save his work to avoid the loss of his work.

This would be a typical scenario where a user is typing information on a textbox and then leaves his computer unattended for a while. Then when he presses a submit button to save his work, he is redirected to login page because his session expired, thus having to type all his information again in the textbox.

How can an alert message be displayed on the screen using ASP.NET 2.0/3.5?

Thanks in advance for your guidance.

G.

A: 

To answer my own question, looks like the best way to accomplish this is to use a setTimeout javascript function to alert a reminder X mins before the session timeout.

ggomez
A: 

One way to do this is by registing ClientScript.

Pass the session expiry value to the client side java script. Which will execute a countdown, and at the end display the Popup.

A.m.a.L
+1  A: 

Reminders are not going to be much use if the user has left their computer for any period of time over 20 mins. The session will still time out. You'd be better off keeping the session alive:

MikeB