What is view state? where it stored? can we disable it ?
Answer Posted / madhuri kumari
The web is state-less protocol, so the page gets instantiated, executed, rendered and then disposed on every round trip to the server. The developers code to add "statefulness" to the page by using Server-side storage for the state or posting the page to itself. When require to persist and read the data in control on webform, developer had to read the values and store them in hidden variable (in the form), which were then used to restore the values. With advent of .NET framework, ASP.NET came up with ViewState mechanism, which tracks the data values of server controls on ASP.NET webform. In effect,ViewState can be viewed as "hidden variable managed by ASP.NET framework!". When ASP.NET page is executed, data values from all server controls on page are collected and encoded as single string, which then assigned to page's hidden atrribute "< input type=hidden >", that is part of page sent to the client.
ViewState value is temporarily saved in the client's browser.ViewState can be disabled for a single control, for an entire page orfor an entire web application. The syntax is:
Disable ViewState for control (Datagrid in this example)
< asp:datagrid EnableViewState="false" ... / >
Disable ViewState for a page, using Page directive
< %@ Page EnableViewState="False" ... % >
Disable ViewState for application through entry in web.config
< Pages EnableViewState="false" ... / >
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How you will manage the state of ASP.NET controls?
We are using Jscriopt validations and at clint site javascript is not running that time validation would work? if yes then how it would behave?
what is silver light when will we use silver light,
How asp.net mvc differs from asp.net web forms? : asp.net mvc
What is the procedure to create the environment for asp.net? : asp.net mvc
What is viewstate? What does the “enableviewstate” property do?
Why cyclomatic complexity is important?
What are the authentication types in asp.net?
Do gac'ed assemblies have fulltrust?
What is data grid view in asp.net?
if i want to give an alert message like "try after sometime" to a web page which is being seen by other person.if a web page is not seen by anyone then it should display otherwise it show a display a message stating that other person is viewing so try after some time........how can i implement this.
What are the 3 types of web?
What are the advantages of using Master Pages?
What is a master page and what does it do?
In Data grid the question is below quantity price total these are 3 fields available in data grid if you enter quantity the total has to update automatically.Price field is already filled completely