locked
HTML5/JavaScript saving page data when navigating

    Question

  • I have three pages in my app. In the default.html, I have three buttons that will navigate to those three pages. In one of those pages, a user will input data into a text box. If the user were to click one of the other buttons then switch back, how do I code it so that the data they entered before remains in the text box? Currently the page reloads back to its initial state without the text input.
    Monday, February 24, 2014 3:15 AM

Answers

All replies

  •   You will have to save your data in either Local, roaming or temp data objects. Detailed guidelines and examples are found at this link:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465109.aspx

    Write data to the appropriate data object for your app, and read it back to display.


    sonal

    • Marked as answer by JYount Monday, February 24, 2014 9:29 PM
    Monday, February 24, 2014 7:01 AM
  • Hi JYount,

    Besides Sonal's suggestion, if you navigating the page by navigate function, to set a initialState is also suggested. The choice really depends on what your scenario is.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, February 24, 2014 7:27 AM
    Moderator