From all types of state management techniques in ASP.NET, ViewState is to be dependent for support on a dictionary collection, and each item is indexed with a unique string name. Below is the sample
ViewState["NameVariable"] = "DotNetFunda";
You can also access the above variable anywhere within the page/control where the ViewState variable has been added. Below is the sample
string Name = (string) ViewState["NameVariable"];