what are the scopes of block level, function level and global level of a page.
I presume block is a part of a pg and function is a function but what's global? the entire page? and if so whats the differene between global and page scope?
thanks
Printable View
what are the scopes of block level, function level and global level of a page.
I presume block is a part of a pg and function is a function but what's global? the entire page? and if so whats the differene between global and page scope?
thanks
Scope progresses from:
- Block
- Function
- Page (Class)
- Global
A page in ASP.Net is a class. So really, you should learn to substitute Class for Page terminology wise. Global scope is available throughout an entire assembly, so two classes can reference the variable. Normally, you'd use a public static readonly field on a variable you want accessed globablly.