Frage

I am using ASP.NET 2.0. I have EnableViewState="false" is set on master page and all my pages and have EnableViewState="true" is set on some controls. It works okay on TextBox, but DropDownList for unknown reason absolutely ignores local EnableViewState="true" and losses its values.

I have found one answer here https://stackoverflow.com/a/11787177/758815 , but it based on ViewStateMode property, which seems only appeared in ASP.NET 4.0.

Any ideas on this matter?

War es hilfreich?

Lösung

Container's EnableViewState setting overrides any child control EnableViewState setting, so if it is set to false at page level setting it to true on any of the control has no effect.

Not sure why it works on the TextBox, perhaps it's not a part of the hierarchy.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top