July 12, 2011

How to store and read value in ViewState

ViewState["Blog"] = "Google Blogger";
Now we can read value from ViewState["Blog"] at current page any time.
It's life will be available for current page only.
It will be available after postback.

string blog = ViewState["Blog"].ToString();

No comments:

Post a Comment