Thursday, July 21, 2011

asp.net using viewstate properties

//C# code
public int intView
        {
            get
            {
                object obj = ViewState["intView"]; //set obj as a the value of intView
                return (obj == null) ? 0 : (int)obj;  // if obj is null return o else return obj which is intView
            }

            set { ViewState["intView"] = value; } // set intView to obj
        }

No comments:

Post a Comment