R – ASP.NET Dropdown – Works when MasterPage EnableViewState = true

asp.netdrop-down-menu

I have a drop down menu and on postback, I cannot get the selected value.

  • MasterPage EnableViewState = False
  • Content Page ViewState = true
  • DropdownList Control ViewState = true

Doesn't work

If I switch the Masterpage EnableViewState = true, it works, however the rest of the site really doesn't need view state so ideally I want it to be enabled.

The Databinding happens in the Page_Init Handler and there is a Page.IsPostBack clause in it.

Any ideas?

Best Answer

There is only one Viewstate per page(aside from control state, which is stored in viewstate). If you turn it off at the Masterpage, it is turned off on the page.

Related Topic