enableViewState for single control

  • Thread starter Thread starter AC
  • Start date Start date
A

AC

Hello, All

Is it possible to set enableViewState='true' for single control on a page
with enableViewState='false'. In particular I am interested in DropDownList,
but neither using IDE to set controls attribute nor <asp:dropdownlist
EnableViewState="True" ...> seems to work.

What is wrong here? Any reference for a good description of enableViewState
use cases will be great.

And I cann't figure our, how does Page.enableViewState relates to
DropDownList.enableViewState (if does).

Thanks for you time!
Alex.
 
Let's say you have a Panel with a textbox in it. The Panel's Visible
property is False, the Textbox's is True.

Do you expect to see the textbox? No. When the panel is invisible, so is
everything else in it, regardless of its own visibility.

Same goes for viewstate.

If you turn off viewstate for the page, the viewstate settings for the
controls on the page is ignored.
 
Back
Top