Monday, June 18, 2012

ViewState


ViewState is like session, but it just occur in one page and not whole web like session.
This is how we make ViewState:

public String Text
        {
            get 
            { 
                object o = ViewState["Text"]; 
                return (o == null)? String.Empty : (string)o;
            }

            set
            {
                ViewState["Text"] = value;
            }
        }



public int Digit
        {
            get 
            { 
                object o = ViewState["Digit"]; 
                return (o == null)? String.Empty : (string)o;
            }

            set
            {
                ViewState["Digit"] = value;
            }
        }

No comments:

Post a Comment