My application is in Asp.net coded C#.
My requirement :
- If someo开发者_运维知识库ne has opened his page and didn't do nothing, then after 5 minutes the page will be closed and the changes will saved. (this feature is exists in bank pages or another pages with protection)
Suggest how can i achieve the needed result.
You will need to use some client-side scripting to accomplish this. In your script you will need to use: setTimeout to set a timer to go off after 5 minutes of inactivity. (The timer should get reset whenever the user is actively doing something). When the timer goes off, call a function to postback to do a "save and exit".
Like @CodeOfChaos says Javascript might not let you close the browser. In my opinion it would be better to redirect the inactive user to a page telling them "Your changes have been automatically saved and you have been logged out."
精彩评论