propagating variable value through out web site pages.

C

Carlos

Hi again all,

this question probably has more to do with the .net language specification
(VB or C#), than with ASP .Net, but I am learning along the way, and
now I am faced with the need to make the value of a variable that I capture
in my start-up page, available in pages that the user will be navigating.
Being that the classes are defined in the same namespace, how do I decalre
a variable in the page that will be using the variable defined in the root
class. I know that I can make it derive from it, but I just want to know if
there is a better, and easier alternative.

Thanks again,

Carlos.
 
E

Eliyahu Goldin

Carlos,

All class members except static (Shared in VB) disappear after the page is
built and rendered. Inheritance won't help. You need to put the veriable in
a persistant storage. Depending on the scope you need, it could be Session,
Application. Static variables have scope of application.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top