What does the "EnableViewState" property do? Why would I
want it on or off?
Answer Posted / satish v itagi
Web page is a stateless entity. To preserve data between
postbacks dot net provided to containers viz. ViewState and
Session.
Viewstate enables persistence of data across post backs in
web forms of dot net (web pages). The data is stored in
hidden field/s of the page. Hence data travels across
media between server and client making loading and un-
loading slow. The advantage is every page will have its
own viewstate data. Normally web controls will have
viewstate enabled. If viewstate is turned off, other data
also can be saved in viewstate.
Objects have to be serialised before putting in viewstate.
While accessing methods and properties of an object the
object has to be properly type casted.
At times, viewstate of a page can get corrupted, requiring
the whole application to be re-started. It is not good
idea to keep large objects in viewstate.
If performance is the issue turn off viewstate, if
persistence is the issue and you have small to medium sized
data enable viewstate.
Keeping state in Sessions is also a better solution.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are main return types supported in Web API?
How can we secure the data which is send from client side to server? Like the login id and paasword needs to be authenticated on the server but we cannot send it in plain text into the server.One more thing we are not using the SSL here.
Why should i prefer JSP over asp.net or any other web development language..??
How do you hide the columns?
How to deploy/publish webservices?How many ways?Plz explain me
What are custom controls?
How you can return View from ASP.NET Web API method?
What symbol specifies the beginning of a query string?
What is autopostback in asp net?
What is an example of an application service provider?
Which protocol is used to call a web service?
Which is faster union or union all?
Explain asp.net application life cycle?
What are Authentication and Authorization?
What is server transfer?