Hello,I'm currently trying to debug an issue... I am doing a response.write() to see the value of some variables at key times. I am confused by what I'm seeing with a viewstate variable.in the page_load event handler, I have a response.write to show the value of the viewstate variable, also in the page_load event handler there is code that runs only if it is not a postback, in this condition the viewstate variable is initialized to a default value. On first load of page, not postback, the values look as expected. Now, there is a dropdown control on the page that is set to auto postback, and it's selected_index_changed event handler changes the viewstate variable. Now upon changing the value of the dropdown, which fires selected_index_changed handler where viewstate variable is modified and does postback, when the page loads after postback and my diagnostic response.write again shows value of this viewstate var, the value is unchanged? it's the default value? BUT, when I change the dropdown AGAIN, the next postback shows the viewstate var has the value I expected to see on the last postback... when I continue to change the dropdown each time it seems my response.write shows my viewstate variable's value is one behind what's expected.. So what am I missing here?
View Complete Post