SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't seem to manipulate the items displayed in a DropDownChoiceField I have that's tied to a field on the custom content type with big, really frustrating problems.

This field is only visible in edit mode.

When I use C# to add/remove items it displays fine, i.e. - it removes/adds the items I have specified. (Bearing in mind this field is automatically populated as it's tied to the choices I've specified in the content type's xml). It even allows me to save and close the page. But then, from design mode, when I go into edit mode I'm getting the following error:

Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

I got around this by changing the ascx to enableviewstate=false, but now it doesn't save to the field!?

Really frustrating. If anyone can suggest a way I can create my own dropdownlist and populate the relevant page's property in code behind then I'll happily opt for this as an alternative. I just don't know where to go from here.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.