Re: Q: define values for all pages
- From: Tom.PesterDELETETHISSS@xxxxxxxxxx
- Date: Fri, 15 Jul 2005 05:05:49 -0700
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.?
.
- References:
- Q: define values for all pages
- From: JIM.H.
- Q: define values for all pages
- Prev by Date: RE: Q: define values for all pages
- Next by Date: Security/Trust Level on Web Application
- Previous by thread: RE: Q: define values for all pages
- Next by thread: Security/Trust Level on Web Application
- Index(es):
Relevant Pages
|