How to autosave a web form in every 10 seconds till the user log out. Is there any method using system.thread.sleep class.? Or is there any other feasible method to achieve this. I am using .net 2.0. Thanks in advance.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As a hint to help you move on, and using jQuery here is some code:
Now what I do here.
Starting with this line, I capture all the
inputthat are the changes by the user controls. All exept the one that I have flagged withExcludeFromNoticebecause some of them I do not won to be part of the autosave process.you can set that to a control as
"ExcludeFromNotice=true"on properties. Alternative you can set a class only to the controls you like to be part of the auto-save notification.Now on
TriggerChanges()what I do is to create a time that is fired after 10sec that user not make other changes.And the rest part that is the most difficult, if the
MakeAutoSave(), there you need to collect and post the autosaved data.Some extra pages that can help you make the ajax call that saves the data:
http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/
How to post form data in asp.net using ajax