Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
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 Jul 12 '12 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. –  DeeMac Jul 12 '12 at 8:38

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

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

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