Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How can I save a pages state and reaasemble it after navigating away?

How can I save a pages state and reaasemble it after navigating away?

Scheduled Pinned Locked Moved ASP.NET
databasequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jim Taylor
    wrote on last edited by
    #1

    Hi, I need to be able to save a pages state/appearance (in a database / text file) e.g. text entered in text boxes, grids selected index datakey, check boxes checked status etc. this is so that if a user revisits the same page in a session the page will appear as it did when they last visited it. This is all handled during postbacks but not if the user navigates away. it would be nioce if I could handle this without explicitly saving every change that a user makes on each control e.g. adding "onchange" code to every control and saving it each time a change is made. Does anybody have any ideas on how I could acheive this? Jim

    J 1 Reply Last reply
    0
    • J Jim Taylor

      Hi, I need to be able to save a pages state/appearance (in a database / text file) e.g. text entered in text boxes, grids selected index datakey, check boxes checked status etc. this is so that if a user revisits the same page in a session the page will appear as it did when they last visited it. This is all handled during postbacks but not if the user navigates away. it would be nioce if I could handle this without explicitly saving every change that a user makes on each control e.g. adding "onchange" code to every control and saving it each time a change is made. Does anybody have any ideas on how I could acheive this? Jim

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      How about creating a class that has properties for all your variables, and then filling it and storing it in the Session object?

      J 1 Reply Last reply
      0
      • J J4amieC

        How about creating a class that has properties for all your variables, and then filling it and storing it in the Session object?

        J Offline
        J Offline
        Jim Taylor
        wrote on last edited by
        #3

        Thanks for your suggestion... but the data needs to be retained after the session has finished. This is so that the users can transfer their work to another user, swap PCs if theirs has crashed etc. At the moment I have added a method in Page Unload to loop through all the controls in the page and save their data to a database. Not sure its the most effective way. Jim

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups