Tuesday, February 19, 2008 9:23 PM InfinitiesLoop

TRULY Understanding ViewState, the comment index

A long time ago I published one of my first blog entries, TRULY Understanding ViewState. And what an experience it has been. It was pretty popular with commenters, so much so I decided to spin off a whole series of articles, TRULY Understanding Dynamic Controls based on some of the issues people were asking me about.

In the meantime, TRULY Understanding ViewState has accumulated over 250 comments! Most are questions from developers facing problems they cannot solve or architects seeking advice on how to approach a project. I've tried hard to answer each and every commenter with a meaningful answer. I have missed some, but I haven't forgotten about them -- they are still in my outlook inbox with that little red flag on them.

I do enjoy helping people, and I don't expect anything in return -- but here's a reader who really gave back. Trevor Morrison painstakingly combed through each and every comment in TRULY Understanding ViewState, categorized and indexed them, and compiled them into a 69 page word and pdf document! I cannot even imagine how much work that was, thank you Trevor!! He even took the time to highlight key statements throughout. I remember college, and how great used books were, because usually some overachiever had already highlighted all the important parts for me.

Trevor has also been gracious enough to let me publish the index here, for all of you to benefit.

Behold, just one page of the table of contents.

TRULY Understanding ViewState Comments Index - Table of Contents

 

And a random page within... notice the category.

 

TRULY Understanding ViewState Comments Index - Example Page

 

Download the TRULY Understanding ViewState Comment Index [word]. Also in PDF.

If for any reason the above links do not work for you, try the mirror site below, courtesy of Colin Bowern:
http://rockstarguys.com/blogs/colin/archive/2008/02/22/truly-understanding-viewstate-mirrored.aspx

Filed under: , ,

Comments

# re: TRULY Understanding ViewState, the comment index

Wednesday, February 20, 2008 4:37 AM by podi

many, many thanks for your efforts, you (both) helped me "truly understand viewstate" - at least I think so:)

# re: TRULY Understanding ViewState, the comment index

Wednesday, February 20, 2008 9:46 AM by Nautilus

What a perfect and touching work!

Power of Community is Power of Sharing ...

# re: TRULY Understanding ViewState, the comment index

Wednesday, February 20, 2008 11:28 AM by Erick Stubbs

That article, and the dynamic controls series are pure internet gold.  They should be mandatory reading for anyone coming into the asp.net world. In my opinion they are problably the two most important articles i've found in regards to "truly understanding asp.net"   I'd love to see more articles from you along those lines.  

# re: TRULY Understanding ViewState, the comment index

Wednesday, February 20, 2008 12:11 PM by Naeem

Thanks for you service in the truely competitve age.

# re: TRULY Understanding ViewState, the comment index

Wednesday, February 20, 2008 3:43 PM by Bertrand Le Roy

Dude, that's a book. Publish it!

# re: TRULY Understanding ViewState, the comment index

Thursday, February 21, 2008 5:25 AM by Ohad Aston

The article "TRULY Understanding ViewState" is really really really good, and i am planing to write about your article in my blog.

Thanks vey much!

# re: TRULY Understanding ViewState, the comment index

Sunday, February 24, 2008 3:28 PM by Trevor Morrison

While I appreciate Dave's warm thanks (who wouldn't?), I was just glad to make the vital content of the discussion about "Truly Understanding Viewstate" even more accessible. It's to Dave that the asp.net developer community should continue to direct their thanks.

# re: TRULY Understanding ViewState, the comment index

Thursday, March 6, 2008 9:47 AM by Troy

Thanks so much for your articles... awesome.

I believe a light went on for me and I'd like to confirm this:

If I have a dropdownlist control, I don't need the viewstate to "remember" the selected value for me as long as the control is always visible (meaning it will always post its value back, meaning the ProcessPostData event will persist my selected value automatically)

If I get into hiding and redisplaying the control over different postbacks, THEN I need the viewstate to remember my selected value for me (only when the control is not present to post the value back)(view state would also remember other non-posting properties like Visible=false).

The above is also true, if databinding is used, as long as the databinding is performed in the OnInit event - so that the control is databound and populated BEFORE the ProcessPostData event.

Is all of that correct?

# re: TRULY Understanding ViewState, the comment index

Wednesday, August 20, 2008 12:38 AM by CrazyTasty

Holy chowder!!!  Hats off to both Dave & Trevor.  Those were both good reads and I now have a better understanding on the subject.

Cheers guys...

cT

# re: TRULY Understanding ViewState, the comment index

Wednesday, September 3, 2008 6:33 PM by free

hi, Dude, that's a book. Publish it.

# re: TRULY Understanding ViewState, the comment index

Friday, March 20, 2009 6:52 PM by Per Erik Stendahl

Thanks a million for spending all that time explaining this non-obvious stuff! Very helpful.

# re: TRULY Understanding ViewState, the comment index

Tuesday, June 15, 2010 12:43 AM by Rupesh Tiwari

Hi ,

I want to make one cutom control i am trying to make one multiselect dropdownlist. So i created one class inherited from usercontrol and oninit i added one listbox and text box and one button. Arranging them so that it will look like a combo box. I am puting enableviewstate flase in page level. So , i am binding my listbox oninit event of the page. However, when i do postback by clicking any other button of the page then selected item persists but, OnSelectedIndexChanged event raised automatically. I do not want to raise OnSelectedIndexChanged i just want to do postback. Can you tell me how to overcome this.

Thanks in advance

# re: TRULY Understanding ViewState, the comment index

Tuesday, March 1, 2011 9:52 AM by William Kreh

Thanks for providing information making "Truly Understanding Viewstate" more available and understandable.  Keep the good articles coming.  Many Thanks

# re: TRULY Understanding ViewState, the comment index

Thursday, March 24, 2011 10:38 AM by Ross

I'm posting this here since comments are closed on the original post. A lot of the comments said to call the Master property getter during PreInit to get the child controls created. This no longer works with .Net 4.