What is view state? where it stored? can we disable it ?



What is view state? where it stored? can we disable it ?..

Answer / 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

More ASP.NET Interview Questions

Give an example of what might be best suited to place in the application_start and session_start subroutines?

0 Answers  


What is smpte vc-1?

0 Answers  


About CLS and CTS ?

3 Answers   Microsoft,


What is asp net application object?

0 Answers  


What are the media types of http requests and response?

0 Answers  






What methods are fired during the page load?

3 Answers  


What is reflection and disadvantages of reflection?

6 Answers   Microsoft,


How to disable validator control by client side JavaScript?

0 Answers  


Can we use MSSql as backend in asp.net...if yes then How.?

0 Answers   MCN Solutions,


What is a Repeater Control and how does it works? and what is the diffrence b/w Gridview,datalist and repeater control?

2 Answers   USi,


What is the displayafter property in updateprogress control?

0 Answers  


Is it possible to disable the minimized icon of a popup window using window.open. Not using iframe concept?

3 Answers   AFAS, Take United,


Categories