C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

ViewState in ASP.Net


Posted Date: 04 Jul 2009    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: R.VijayaragavanMember Level: Gold    
Rating: 1 out of 5Points: 7



What You Mean by ViewState:
Viewstate is a built-in structure for automatically retaining values amongst the multiple requests for the same page. The viewstate is internally maintained as a hidden field on the page but is hashed, providing greater security than developer-implemented hidden fields do.

Performance for viewstate vary according to User controls:
Performance of viewstate varies depending on the type of server control to which it is applied. Label, TextBox, CheckBox, RadioButton, and HyperLink are server controls that perform well with ViewState. DropDownList, ListBox, DataGrid, and DataList suffer from poor performance because of their size and the large amounts of data making roundtrips to the server.

Benefits and Limitation of using Viewstate for State management:
Benifits of Using ViewState:
a).No server resources are required because state is in a structure in the page code.
b).Simplicity.
c).States are retained automatically.
d).The values in view state are hashed, compressed, and encoded, thus representing
e).A higher state of security than hidden fields.
f).View state is good for caching data in Web frame configurations because the
data is cached on the client.

Limitation of using Viewstate:-
a).Page loading and posting performance decreases when large values are
stored because view state is stored in the page.
b).Although view state stores data in a hashed format, it can still be tampered
because it is stored in a hidden field on the page. The information in the
hidden field can also be seen if the page output source is viewed directly,
creating a potential security risk.

Below is sample of storing values in view state.
this.ViewState["EnterTime"] = DateTime.Now.ToString()



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
ViewState in ASP.Net  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Guide to State Management Techniques in ASP.NET
Previous Resource: Validation Controls in ASP.Net
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use