locked
Save Page Data If Browser Crash ? RRS feed

  • Question

  • User1890471016 posted

    Hello World

    i am working on an application on which i have to create a feature like save the data if browser crash.

    i have some Data Entry Pages in my project where user can add entries first i am saving page entries into a temp datatable and when user finally click on Save button than i will save that data permanantly to database. Now i want if accidently user browser crash for any reason whenever he reopen the page all unsaved data will remain same.

    Please let me know ASAP

    Monday, October 17, 2011 2:56 PM

Answers

  • User1259239129 posted

    Think about this senario,

    When users entering the form on the page, the page crashes or get closed by accident. There is on postback to the server yet, the only way you can save the data is through the client side.

    Try to save the data of the form element for example: saves data to cookie or ajax call back when user finish typing on a textbox....

    Just some ideas.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 19, 2011 11:16 AM
  • User-821857111 posted
    Use Ajax to periodically post the data to the server and save it in a database if your form data exceeds 4 kb
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 21, 2011 1:01 PM
  • User-821857111 posted

    You can set a timer to periodically serialize the form data and post it to the server: http://api.jquery.com/jQuery.post/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 21, 2011 1:48 PM

All replies

  • User-821857111 posted

    You could set a cookie when the page is first requested, and use Javascript to periodically save the form field values to it. Kind of like an AutoSave feature. If the user clicks submit, clear the cookie. If a user requests the page and they have a cookie, you know the page wasn't previously saved. Read the form values from it and repopulate the form.

    But to be honest, I think this sounds like a lot of work for little or no real return. I'm glad I'm not paying for your time.

    Monday, October 17, 2011 3:30 PM
  • User1890471016 posted

    What about Caching ? Can i use Caching. bcoz i dont want to use autosave like feature

    Wednesday, October 19, 2011 1:28 AM
  • User-821857111 posted

    Caching doesn't provide a solution. That is a way of storing data in memory on the server. When someone is filling out a form, the data has not reached the server.

    Wednesday, October 19, 2011 8:24 AM
  • User1259239129 posted

    Think about this senario,

    When users entering the form on the page, the page crashes or get closed by accident. There is on postback to the server yet, the only way you can save the data is through the client side.

    Try to save the data of the form element for example: saves data to cookie or ajax call back when user finish typing on a textbox....

    Just some ideas.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 19, 2011 11:16 AM
  • User1890471016 posted

    but there is a limited data can be stored in cookies i think so. Do you have some another solutions to relevant problem....

    Friday, October 21, 2011 7:24 AM
  • User-821857111 posted
    Use Ajax to periodically post the data to the server and save it in a database if your form data exceeds 4 kb
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 21, 2011 1:01 PM
  • User1890471016 posted

    Will be please elaborate it how to do it.....

    Friday, October 21, 2011 1:23 PM
  • User-821857111 posted

    You can set a timer to periodically serialize the form data and post it to the server: http://api.jquery.com/jQuery.post/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 21, 2011 1:48 PM