Jul 12, 2006 - 07:23 PM
I can give you an answer for .Net. You have three areas in .Net where you can save information: Viewstate, Session State and Application state. Depending on where and how you want to use the information you select the correct area.
information is available for the same webpage. Example, you load data into a drop down field and want to load it only once for this page. You enable viewstate for the drop down component and it keeps the data between posts
you want to have data available for the same session but across different web pages/forms. You can save almost anything which is serializable to Session state. And session state can be held in memory of the web server, on another state server or even in a database. Key is the session ID
You create a new entry in session state in C# with:
//Fill array or do something
Session["MyArray"] = MyArray;
You retrieve Session state data with
AnotherArray = Session["MyArray"];
If you want to make data available across sessions. I.e. global data for every user!
Note, Application State has to be initialized before you can use it. Best place to do thi sin an ASP.Net app is in the ApplicationStart Event.
You create Application state with
Application["AppCount"] = 0;
You can then use Application["AppCount'} on every page in this application. Across sessions and users!
Let me know if you need more information
Jul 14, 2006 - 11:23 AM