View Full Version : Why does setting EnableViewState=false on PostBack de-select the items that are selec

08-11-2011, 08:52 PM
Fellow ASP.NETers,

For the page I am currently working on, I have two ComboBoxes and an ASP.NET checkbox list. The first ComboBox filters the second ComboBox, and the second ComboBox populates the ASP list. The issue I am having is that if I leave EnableViewState set to true for the second ComboBox, it does not display the filtered results. When I set EnableViewState to false the second ComboBox and the first work perfectly, but on PostBack all of the selected items on the asp list get deselected.

Yes I am a 100% sure it is the EnableViewState that is causing the issue. Any ideas?

PLEASE HELP ME FIX THIS!!! I really need to its urgent!! I will vote best answer for this because I can't seem to solve this issue.

08-12-2011, 11:50 AM

UpdatePanels could be the answer.

If the items are placed in an update panel you can trigger an action to update a particular update panel.

This also leaves anything outside of the update panel untouched on postback.

08-16-2011, 08:18 PM
I think it's obvious the viewstate is responsible for saving values between postbacks.

For more detail refer to the following: