문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top