Understanding View State in ASP.NET
page 1 of 9
Published: 30 Jun 2006
Unedited - Community Contributed
Abstract
The ASP.NET ViewState is a powerful feature and maintains the state of pages between postbacks. This article provides a bird's eye view of View State with code examples whenever appropriate.
by Joydip Kanjilal
Feedback
Average Rating: 
Views (Total / Last 10 Days): 144812/ 209

What is ViewState and what it is not?

There are some common misconceptions about ViewState.  Let me discuss these points here for the benefit of the readers.  ViewState does not hold the controls, rather it holds the values of the form controls and their corresponding ID's that would otherwise be lost due to a post back because they do not post with the form.  ViewState is not used to hold session data or to transmit data between pages.  ViewState does not recreate the dynamically created controls of a page.  It does not restore the values to the controls after a post back operation.  Taken aback? Yes, it is true.  Even when the ViewState for a control is disabled, still the value would be retained after a post back of the page occurs, for input controls like TextBox or DropDownList.  So then, what is ViewState?  ViewState represents the state of a page when it was last processed on the web server.  It holds the values of a control that has been dynamically changed.


View Entire Article

User Comments

Title: very good   
Name: hasitha
Date: 12/29/2006 8:08:54 AM
Comment:
u're explaned well.Thank u very much 4 u'r help
Title: i have one question   
Name: Satheesh
Date: 12/27/2006 2:15:56 AM
Comment:
I have two webpages in asp.net.... one page contains a textfield and a button.... i am storing the value entered in the texbox to viewstate... and i want that viewstate value to be accessed the next page's textfield control... i am getting null reference exception.... how to solve this
Title: Fine   
Name: senthil
Date: 11/16/2006 3:41:03 AM
Comment:
its really very good, now only i know how to disable viewstate in application level and machine level.
Title: Good Article   
Name: Sebin
Date: 11/15/2006 1:04:07 AM
Comment:
This is a good article. Try to post more article from JOY
Title: good explanation by joydip   
Name: chrsankar@yahoo.com
Date: 11/3/2006 4:59:55 AM
Comment:
I have also read few other articles of Joydip.He is really excellent.Please share your knowledge
Title: View State   
Name: Rakesh
Date: 10/17/2006 11:00:03 AM
Comment:
Very Useful.
Title: Its Good One   
Name: Prashant Narvekar
Date: 9/23/2006 2:10:45 AM
Comment:
its good one. i really liked it.
Title: View State   
Name: Waqas
Date: 9/20/2006 2:13:38 AM
Comment:
Nice Article! Keep it up.
Title: Understanding ViewState ASP.NET   
Name: Satya
Date: 9/12/2006 11:30:29 PM
Comment:
its really nice, you have explained it very nicely with example. Thanks a lot.
Title: great   
Name: nirwan
Date: 9/8/2006 12:48:29 AM
Comment:
great article
Title: Thank you   
Name: Keroles
Date: 9/7/2006 5:53:44 PM
Comment:
Thank you for this article
Title: viewstate   
Name: Manoj kumar singh(infotek software and system (p) ltd)
Date: 9/7/2006 2:51:21 AM
Comment:
This is an excellent article which would help for all asp.net developer
Title: very nice   
Name: jayasimha
Date: 9/2/2006 2:59:26 AM
Comment:
this article is very nice to understand the view state concept
Title: Coooooooool   
Name: ARauf
Date: 8/31/2006 1:02:04 PM
Comment:
I liked the way the author explained using examples. Nice work buddy..
ARauf from Pakistan
Title: Nice Article   
Name: Rakesh Nandrajog
Date: 8/30/2006 5:38:49 PM
Comment:
Really nice article
Title: View State   
Name: Jason Hunt
Date: 8/30/2006 10:02:59 AM
Comment:
An excellent article. Viewstate is often bloated on new developer's websites. I, myself, presumed I knew enough about it and you and certainly proved me wrong. I'm going to use your information on new development. Thank you for your article and I hope you continue to "educate" the masses.
Title: Superb   
Name: Sana
Date: 8/30/2006 9:30:07 AM
Comment:
Good article. Clearly said.
Title: hmm   
Name: Rah
Date: 8/30/2006 7:44:14 AM
Comment:
Continue with the rest of the articles
Title: More detailed explanation   
Name: rekna
Date: 8/30/2006 6:40:07 AM
Comment:
You can find a more detailed explanation of the viewstate on http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx. It's a long article, but very important to understand the real workings of viewstate, and to avoid some common mistakes!!!
Title: Understanding View State in ASP.NET   
Name: Jitu
Date: 8/30/2006 5:03:45 AM
Comment:
Really good explaination of viewstate. Author has cover almost all areas of viewstate. Best for beginer and confused programmers.
Title: viewstate   
Name: yogesh
Date: 8/25/2006 6:31:28 AM
Comment:
good
Title: Sanjay's View state   
Name: Sanjay Jaiswal
Date: 8/10/2006 6:59:41 AM
Comment:
This topic was little bit confuse d forme...but after rading this......give the whole logic behind the View State.



extremely good enough!!!!
Title: view state in asp.net   
Name: srilatha
Date: 8/2/2006 5:43:34 AM
Comment:
Hai,
The article is very informative. Thanks a lot.
Regards,
srilatha
Title: nice way   
Name: Mahesh Kumar Sharma
Date: 8/1/2006 9:53:36 AM
Comment:
This topic make little confuse me but joydip u done exelent job No body will explain in such deep..like Joydip has explained.. Thanx...
Title: good one   
Name: saurabh
Date: 8/1/2006 6:04:48 AM
Comment:
u have explained it in a very nice way. please carry it on. i am expecting some more topics to be covered from tou.
Title: great n excellent   
Name: Anonymous
Date: 8/1/2006 5:24:37 AM
Comment:
No body will explain in such deep..like Joydip has explained.. Thanx...
Title: asp.net examples   
Name: Farooq Ahmad Salmani
Date: 7/14/2006 8:24:54 AM
Comment:
I want more Examples of asp.net
Title: View State   
Name: Françoise
Date: 7/11/2006 11:55:28 AM
Comment:
This is a very good explanation the the View State concept.

Thank you very much. 07/11/2006
Title: Very Nice   
Name: Koteswara Rao
Date: 7/10/2006 10:28:56 AM
Comment:
Hi,
You have Explained very well about View state in Asp.net. It is most useful for whome Newly started programing in Asp.Net
Title: nice   
Name: venu
Date: 7/8/2006 2:52:59 PM
Comment:
hi, U explained very well.

some more topics we are expecting from U.
Title: view state   
Name: G.srinivas
Date: 7/6/2006 1:55:21 AM
Comment:
hi,
this site is very useful for the individuals who want to improove their subject.i am thankful to them who had prepared it.this site is helped me to know everything about viewstate in asp.net.oncegain thanking u
from,
srinivas.G
Title: View State   
Name: Hadi Alhendi
Date: 7/4/2006 3:10:54 AM
Comment:
I found this article very useful i want to thanks Joydip for this great article
Title: Very Good   
Name: Rajesh Medackel
Date: 7/4/2006 1:07:19 AM
Comment:
That was a very good one......:-)


Rajesh Medackel,India
Title: Do The Best   
Name: Viamlram
Date: 7/4/2006 12:53:58 AM
Comment:
You are explained well.It is derived easy to understand by the beginer.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2014 ASPAlliance.com  |  Page Processed at 11/28/2014 6:57:47 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search