What is View state ?
It is important and useful client side state management mechanism. It can store the page value at the time of post back. ASP.NET provides the ViewState property is built-in structure which automatically storing data between multiple requests for the same page.
It is important and useful client side state management mechanism. It can store the page value at the time of post back. ASP.NET provides the ViewState property is built-in structure which automatically storing data between multiple requests for the same page.
Defining View State:
ViewState["Var"]=Count;
Retrieving information from View State
string Test=ViewState["TestVal"];
@Code snippet to access View State
<script language="javascript" type="text/javascript">
var GetValue = document.getElementById("GetValue");
alert(GetValue1);
</script>
@Code in server side
ViewState["value"] = "Test View State";
Page.ClientScript.RegisterHiddenField("GetValue", Convert.ToString(ViewState["value"]));
No comments:
Post a Comment