GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET 2.0
Go To First  |  Previous Question  |  Next Question 
 ASP.NET 2.0  |  Question 56 of 161    Print  
What are the disadvantages of viewstate/what are the benefits

  
Total Answers and Comments: 3 Last Update: April 28, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: prashanthdd
 
Advantages:-

Simplicity:There is no need to write possible complex code to store data between pagesubmissions.
Flexibility:It is possible to enable,configure and disable controls on controlbasis.

Disadvantages:

Doesn't track across pages. Viewstate does not transfer data from one page to another automatically. Viewstate is not usefull to transfer data for backend systems.



Above answer was rated as good by the following members:
sanju patel
February 07, 2006 08:22:35   #1  
Praveen Kumar        

RE: What are the disadvantages of viewstate/what are t...
Viewstate has lots of advantages and as well as disadvantages so you need to weigh carefully before making the decision to use it. As view state doesnt require any server resources for its operation. It is passed to the client during every postback as an hidden element. Since it is added with every page it adds few Kbytes to the page. This effects the loading of the page in the client. Other main problem with Viewstate is since it is passed as plain text to the client. Anybody can tamper this value because of this you shouldnt store any important data in the viewstate. View state is one of the most important features of ASP.NET not so much because of its technical relevance but more because it makes the magic of the Web Forms model possible. However if used carelessly view state can easily become a burden. Although ViewState is freely accessible in a hidden field called __VIEWSTATE the view state information is not clear text. By default a machine-specific authentication code is calculated on the data and appended to the view state string. The resulting text is then Base64 encoded only but not encrypted. In order to make the view state more secure the ASP.NET @Page directive supports an attribute called EnableViewStateMac whose only purpose is detecting any possible attempt at corrupting original data.
 
Is this answer useful? Yes | No
June 20, 2007 12:02:46   #2  
Urvil Shah        

RE: What are the disadvantages of viewstate/what are t...
Advantage:

1) Maintains the state for autopostback event.
2) Easy to use.
3) No ServerSide resources required.
4) Passed into HiddenFied.
5) Basic enncryption algorithm is applied when passing the data.

Disadv:

1) When large data is there then perfomance is issue.
2) Good Hacker can get the data very easily.

 
Is this answer useful? Yes | No
April 28, 2008 06:58:36   #3  
prashanthdd Member Since: April 2008   Contribution: 11    

RE: What are the disadvantages of viewstate/what are the benefits
Advantages:-

Simplicity:There is no need to write possible complex code to store data between pagesubmissions.
Flexibility:It is possible to enable configure and disable controls on controlbasis.

Disadvantages:

Doesn't track across pages. Viewstate does not transfer data from one page to another automatically. Viewstate is not usefull to transfer data for backend systems.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape