问题
I have a web page with a editable jquery grid on it. I am using it with asp.net web form. The web form authentication is set to timeout after 20 minutes. Sometimes, users need to update large number of data on the grid and once they click Save, the website often already timeout and user loses the data.
I am wondering whilst user is still active on the grid, can we trigger something in javascript to prevent web form authentication timeout and server sessions timeout?
Thanks
回答1:
check the link jQuery Timer. You can create a timer in jQuery. If your default time out is 20 min, set the timer to call a ajax call to the server after 15~18 min. This call will do nothing. But as soon as you make the ajax call it will set the session active for another 20 min. So, this way you will be able to keep the session live as long as the user uploads data to the grid.
来源:https://stackoverflow.com/questions/16033115/how-to-extend-session-timed-out-with-jquery-ajax