Click to See Complete Forum and Search --> : data persistence over pages


forkirun
November 5th, 2004, 03:27 AM
How can one persist data values over diffrent webpages.
I have a collection objects ,and once the object is populated i want to perisist the object and want to use this object and its peroperties at varied times in diffrent webpages.
I tried the session variabels ,but actually i dont know how to exactly use session variabels with objects and properties. I have read many times that these session variabels are night mare and you should use another ways to make data persistant.

mmetzger
November 5th, 2004, 09:54 AM
Session variables, client side cookies, application variables, query strings, cache, etc are all ways of accomplishing this. It all really depends on what you want to accomplish for determining the best component.

Session variables are pretty easy in asp.net as long as you use cookies. The cookieless version isn't bad per se, but it makes your URLs fairly ugly and makes providing direct links difficult. The main this is to always check for a null value before using a specific session variable. Otherwise you end up with seemingly random null exceptions (in other words, the session timed out.)