0

While filling out a form, some websites like GMail offer an auto save feature that automatically saves the form filled out so far to the database.

If I have to implement that in my MVC 4 application, how do I do that?

I'm thinking of options but I can't find any other than write some JavaScript code myself to make an Ajax call and send data to the server in JSON format and on the server side, respond by having an action on the controller accept that JSON data, deserialize it and save the incomplete data to the database.

But all this seems like a lot of work. I am assuming there should be an easier way.

2
  • 2
    Nope, that's how you do it. Web programming is a lot of work :) Commented Dec 11, 2012 at 17:55
  • Thank you. I feared as much. :-) Commented Dec 11, 2012 at 18:03

1 Answer 1

3

You could try the Sisyphus.js jQuery Autosave plugin. It works by saving the form state in LocalStorage, so that the user can retrieve the partially filled-out form. It has the virtue of not requiring any modifications to the server code, so it should work for any existing ASP.NET MVC application.

Download from Github here: https://github.com/simsalabim/sisyphus

Sign up to request clarification or add additional context in comments.

2 Comments

Does it have a method to clear its data out of the local storage because local storage has a 5 MB max storage limit for the entire host.
Local Storage will be freed of these forms values on submit or reset.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.