G
Guest
Hi,
I'm new to .NET and have a question about the use of static variables vs.
session variables in a web form in C#.
Instead of using a session variable to hold a string to persist during
datagrid paging. Can I use a static variable? Also, if I use a static
variable is that variable shared by everyone that brings up the aspx page?
Ex, if 4 people are viewing the aspx page is an instance of the static
variable created for each of the 4 people? Or is there just one instance of
that static variable shared across the 4 users?
BTW, I am using the session variable/static string to hold the value of some
filter criteria based on what buttons are pressed by the user which would hit
the database with different sql statements.
Thank you.
I'm new to .NET and have a question about the use of static variables vs.
session variables in a web form in C#.
Instead of using a session variable to hold a string to persist during
datagrid paging. Can I use a static variable? Also, if I use a static
variable is that variable shared by everyone that brings up the aspx page?
Ex, if 4 people are viewing the aspx page is an instance of the static
variable created for each of the 4 people? Or is there just one instance of
that static variable shared across the 4 users?
BTW, I am using the session variable/static string to hold the value of some
filter criteria based on what buttons are pressed by the user which would hit
the database with different sql statements.
Thank you.