Store & retrieve value in viewstate - State Management System
Q. How will you store and retrieve value in viewstate?- Published on 28 Jul 15a. // Storing the data in viewstate
ViewState[“SiteName”]=”CareerRide”;
// Retrieving Value from a View State
Label1.Text = ViewState["SiteName "].ToString();
b. // Storing the data in viewstate
ViewState obj=new ViewState
ViewState [obj]=”CareerRide”;
// Retrieving Value from a View State
Label1.Text = ViewState[obj].ToString();
c. // Storing the data in viewstate
ViewState=”CareerRide”;
// Retrieving Value from a View State
Label1.Text = ViewState.ToString();
d. None of the above.
ANSWER: // Storing the data in viewstate
ViewState[“SiteName”]=”CareerRide”;
// Retrieving Value from a View State
Label1.Text = ViewState["SiteName "].ToString();