Here is a simple example of how to store a variable in view state for easy access. The example is using a string but any object/type can be used.
private string GTR
{
get
{
object o = ViewState[ "GTR" ];
return ( o != null ? o.ToString() : "" );
}
set
{
ViewState[ "GTR" ] = value;
}
}
No comments:
Post a Comment