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
What is difference between session and cookies in asp net?
What is routing in MVC?
What is a page life cycle? What are the events in a page life cycle?
What is a postback ispostback and autopostback in asp net?
I want to connect a system in LAN and I want to access that. Whenever I am moving a mouse in my desktop, the similar thing has to happen in another system in which I have connected. I need coding for this in C# and ASP.NET Can anyone please help me. It is very urgent. Thanks in advance. My email id is manojkumarchallagundla@gmail.com Will you please?
Explain how dot net compiled code will become platform independent?
Which is an advantage of application service providers?
Contrast oop and soa. What are tenets of each16. How does the xmlserializer work? What acl permissions does a process using it require?
What is the parent class of all web server control?
What is the difference between a cookie and a pixel?
What is the use of asp.net web api?
Explain the difference between webfarm and webgardens in .net?
Explain significance of routing? : asp.net mvc
What is the difference between union and structure?
Which protocol is used to call a web service?