I have created a webpart that generates the dynamic subsites andgrats access
to the users. For representing the list of users, I have used DataTable with
DataGrid. Actually when ever the page is refreshed, the new instance of
DataTable is created and I always loose my previous data. I want the instance
to be created once for the entire session of the user. I have tried a lot and
researched a lot but no use. Currently I am checking if the DataTable
instance is null or not. And accordingly I create instance. It wont work too.
Can anyone plz help me out in this. Its really urgent.

RE: How to initialize an object just once for entire session by NikanderMargrietBruggeman

NikanderMargrietBruggeman
Fri Apr 08 02:13:01 CDT 2005

Why don't you use the web part cache? Using the partcachewrite en
partcacheread methods of the web part class. By default this means any
information you store is stored in the ASP.NET cache object, but this can be
changed.

Hth, kind regards,
Nikander & Margriet Bruggeman

"Fahad" wrote:

> I have created a webpart that generates the dynamic subsites andgrats access
> to the users. For representing the list of users, I have used DataTable with
> DataGrid. Actually when ever the page is refreshed, the new instance of
> DataTable is created and I always loose my previous data. I want the instance
> to be created once for the entire session of the user. I have tried a lot and
> researched a lot but no use. Currently I am checking if the DataTable
> instance is null or not. And accordingly I create instance. It wont work too.
> Can anyone plz help me out in this. Its really urgent.