Click here to Skip to main content
15,908,775 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone please give me any REALTIME example of using viewstate.
Any good example is appreciated.
Posted

1 solution

First start with this...
View State:
Use viewstate to store data that are accessed by the same page. Ideally a POSTBACK situation.
For example, think of a report. The filter condition is appended as and when the user selects a condition and finally when the user click submit the report is generated. Here we can use viewstate to save the filter condition since the same page is posted back. When we use session here, the filter condition is lost on session expiry.

In general, its a good practice to disable viewstate for datagrids for lengthy reports.

and Beginner's Guide To View State [^]

Example : http://asp-net-example.blogspot.in/2009/01/aspnet-viewstate-example-how-to-read.html[^]
 
Share this answer
 
Comments
waj1206 15-Dec-12 8:03am    
I need a realtime example .i know how it works.
Can anyone please give me a real time use of this.
@krunal rohit thanks for the answer...i need a real time usage of this view state
[no name] 15-Dec-12 8:04am    
See Example link...
waj1206 15-Dec-12 9:04am    
@rohit
Its not that good...
Can u give me a good example REALTIME

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900