Can I say that ViewState variable is equivalent to Dictionary type declared as static:
ViewState["clicks"] <=> static Object clicks = new Object();
You mean the Control.ViewState
property? It's not static, and it's a StateBag
.
StateBag
implements the non-generic IDictionary
interface
No.
ViewState
is definitely notstatic
. It is an instance property ofControl
(seeControl.ViewState
), and can change on every page and on every load of the same page.static
variables in ASP.NET are quite dangerous if they contain personal data, since they are shared across all sessions, so you really don't wantViewState
information to be static.