You got a few options. If you want the scope of the variable to be just the
execution of the page you can place a class in the bin directory (or app_code
in version asp.net2).
That class will be available to all of your asp.net pages and you can make
the varaible static if you don't want to instantiate the class.
You could also make the page class inherit a customized base class so that
it would appear that the variable is 'native' just like the request,response,...
obejct.
If you want that variable to remember its value between page request than
you have to use the session object if you want the scope of the variable
to bo 1 user.
Use the application object if you want the varaible to be seen and modifiable
by all users .
Let me know if you have any more questions..
Cheers,
Tom Pester
Hello,
In my C# asp.net web application, I need to define a few variable that
is
reachable from all pages. If it was C I would define it in the .h file
as
struct and use it in the myStruct.myFirstvalie, MyStruct.SecondValue,
how
should I do this here in asp.net? I guess I should use class, can you
give me
example to handle it.?