Results 1 to 8 of 8
Thread: What is viewstate in ASP?
-
05-25-2011, 08:52 AM #1
What is viewstate in ASP?
What is viewstate in ASP. What is the pros and cons of this
Floor Tiles - Car Donation- Silk Flowers - Term Insurance Quotes - Henna hair dye & tattoos - Church Chairs - Integrated Marketing Communications
-
05-25-2011, 10:47 AM #2
- Join Date
- Apr 2008
- Location
- Boston, USA
- Posts
- 13,172
- Thanks
- 744
- Thanked 699 Times in 550 Posts
- Blog Entries
- 4
- Feedback Score
- 4 (100%)
webpages are stateless. which means server forgets about the content of the page after serving. viewstate is a way of letting the server know what was the previous states of a page, when you make a click or do something on the page and send the request to the server.
pros: easy to code
cons: page size gets largerFree Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK
-
07-15-2011, 01:35 AM #3
Banned
- Join Date
- Nov 2010
- Location
- Delhi
- Posts
- 103
- Thanks
- 0
- Thanked 4 Times in 4 Posts
- Feedback Score
- 0
ViewState is the mechanism that allows state values to be preserved across page postbacks.
Syntax:-
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTM1ODM3Nj......." />
-
08-25-2011, 04:43 AM #4
Senior
- Join Date
- Aug 2011
- Posts
- 671
- Thanks
- 0
- Thanked 7 Times in 7 Posts
- Feedback Score
- 0
view state is a state management technique in asp.net. ASP.NET Viewstate is preserving the data between the requests or postbacks and stored in hidden fields on the page.
-
09-02-2011, 08:30 AM #5
Banned
- Join Date
- Jul 2011
- Posts
- 45
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
ViewState is the mechanism that allows state values to be preserved across page postbacks.
Because of the stateless nature of web pages, regular page member variables will not maintain their values across postbacks. When we need a page variable to maintain its value across page post backs, we can use ViewState to store that value. Values stored in ViewState will be serialized and sent to the client browser as the value of a hidden form input.
-
10-25-2011, 01:51 AM #6
Freshman
- Join Date
- Oct 2011
- Posts
- 13
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
When a form is submitted in classic ASP, all form values are cleared. Suppose you have submitted a form with a lot of information and the server comes back with an error. You will have to go back to the form and correct the information. You click the back button, and what happens.......ALL form values are CLEARED, and you will have to start all over again! The site did not maintain your ViewState.
-
04-10-2012, 01:20 AM #7
Sophomore
- Join Date
- Jul 2011
- Posts
- 104
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
when page runs on server it didn't save the state of the page if you want to check the state of previous page than use view state..
pors:- to view the state of the page, esay to manage
cons:- we have to implement large coding method to maintain the state of the page.
-
04-17-2012, 04:19 AM #8
Freshman
- Join Date
- Mar 2012
- Posts
- 19
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
ASP.NET page framework uses to preserve page and control values between round trips. When the HTML markup for the page is rendered, the current state of the page and values that must be retained during postback are serialized into base64-encoded strings.


Reply With Quote

