1. Use a singleton pattern for the object that encapsulates the Hashtable (or
place it in Application).
public class SingletonHashtable : Hashtable
{
//Cannot instantiate object with constructor
private SingletonHashtable
{
}
//single static hashtable
private static SingletonHashtable a;
public SingletonHashtable GetHashtable()
{
if(a==null)
a = new Hashtable();
return a;
}
}
2. Add users on Session_Start and get rid of them on Session_End.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Annie" wrote:
hello all,
is it possible at all?
i have a class that encapsulates a Hashtable collection. What i want is to
initialise this object once and only once and
then be able to access its Public Static methods always.
What i want is when the user logs in i gets its detail and add him/her in
the hashtable until her/she is online and similarly
for next user and so on until they log out or close the browser then i
remove them from hash table.
I don't know how to inititialize the object once?
Is it possible at all?
TA