0

I have a SharePointWebControls:TextField control on the page. It's tied to a field that has been defined as normal in the xml (I've gone through this with a fine tooth comb so I'm 99.999% sure the definition and fieldref is all in order). I've checked in site settings and the field appears fine on the content type just fine. I've removed and added the field via site settings (this IS a new content type field), but still no luck; the problem is when it comes to saving & closing a page, on attempting to validate it, SharePoint provides the following error:

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.SharePoint.WebControls.BaseChoiceField.Validate() +98
   System.Web.UI.Page.Validate() +116
   Microsoft.SharePoint.WebControls.SPPageStateControl.EnsureItemSavedIfEditMode(Boolean forceSave, String overwriteCommandHandler, String discardChangesCommandHandler) +169

This error isn't shown when I remove the mentioned TextField control from the page, and the following article backs up the idea that it is in fact this control causing the problem:

http://seansharepoint.blogspot.co.uk/2009/09/microsoftsharepointwebcontrolsbasechoic.html

2
  • 1
    So your new field is shown on the Site Content Type? Have you checked that the list has the column defined, and that it is used by the List Content Type? (I.e. have you checked the list settings page for the list that contains your data? This might be the Pages library)
    – Andy Burns
    Commented Jul 12, 2012 at 8:33
  • Thanks a lot for your reply Andy. I didn't check that to be honest, I just have now though and can confirm it's there. Commented Jul 12, 2012 at 8:38

1 Answer 1

0

This is sort of fixed now I suppose. Creating a new site (i.e. using a 'refreshed' version of the content type works), so I'll just get rid of all of the old pages that use the content type. It's still in development so this isn't a big issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.