PDA

Click to See Complete Forum and Search --> : scope


smileyface5
Apr 25th, 2005, 07:20 AM
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

nemaroller
Apr 27th, 2005, 09:53 AM
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.