I am developing a web dashboard under a deadline. We are interested in making a demo release before the dashboard has been fully developed. It does not currently have the concept of a logged in user.
The state of the web dashboard is currently saved into Session. All my classes are serializable, and I was able to set my SessionState Mode to SQL Server and write Session to a SQL Database. In an ideal world I would be able to use this to serve my purposes, but I have been unable to figure out how, if possible.
The goal is this: “Represent the saved state of the web dashboard as text and be able to load the state of the dashboard on another computer.” The method suggested to me was to write XML to a text file and be able to move that text file to another computer, point at it, and load my state again.
My issue with writing Session State to a SQL Server is that when the Session expires (browser closed/time out) I am unable to load the old data up onto the page. If there was a way to say “Take the data from session state _ and load it onto the page” I would be golden. As far as I can tell this isn’t possible.
More on Session State Mode SQL Server: http://msdn.microsoft.com/en-us/library/ms178586.aspx
Does anyone have any pointers or experience with this? What would you do that is quick yet you’re happy with? Ideally I would have this implemented in a day no more than two.
Thanks!
OK, from what you said:
User will access your dashboard, change some settings, and you are currently saving this into session.
They log off – log on again elsewhere and you want to reload their preferences.
Rather than just saving your ‘state’ to session, you could serialise your classes and write them to your database, keying them against your user. You could then load them from the database, de-serialise them and load them up when that user logs in.
If you have no logged in user, perhaps you could have a ‘save state’ button that allows them to enter in their name, and saves the state against that name. They could then have a ‘load state’ button that queries the database for their state.