Click here to Skip to main content
15,886,024 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I have a requirement like, when the session is expired, all the user entered values should save and when the same user is opens the page then the saved details should be displayed on the appropriate controls.

Is there any ways to do the same?

Thanks in advance..
Posted

1 solution

The client page doesn't know when\if the session has expired so you can't easily do this. If your code is giving problems because they submit a form after a timeout, then you can grab the form data from the post and store it somewhere (in their new Session maybe), so that when they go back to the page the data is kept.

Or if you're more worried about people filling a form out then abandoning their browser, then you can use a timer on the client to instigate a "draft save" of the form via ajax every minute or so.

It'll help if you explain what your actual issue is, as the client knowing when the session has ended isn't a viable solution so you'll need to look for an alternative.
 
Share this answer
 
Comments
DPM20 25-Jun-15 5:29am    
Ok... i have one more doubt, if i am using the pageMethods for invoking server side functions from javascript, is there any way to call the server side function without any button click from the user end?
F-ES Sitecore 25-Jun-15 5:41am    
Yes, but *something* has to trigger the calling of the code, some event. That is why a timer is probably the best way of doing it as the timer fires an event each time it "ticks" and that is used to call your code without the user having to do anything.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900