SharePoint Web Part on Masterpage not displaying on SubSite

Posted by madatanic on Stack Overflow See other posts from Stack Overflow or by madatanic
Published on 2010-05-21T18:58:08Z Indexed on 2010/05/21 19:00 UTC
Read the original article Hit count: 226

Filed under:
|
|

Hi all,

Scenario: - A out-of-the-box DataFormWebPart on masterpage connected to a top-level site List. - A subsite using that same masterpage from top-level site. - Error happens when accessing the sub site as below

Stack Trace
[InvalidOperationException: Operation is not valid due to the current state of the object.]
   Microsoft.SharePoint.SPFolder.get_ContentTypeOrder() +488
   Microsoft.SharePoint.SPContext.get_ContentTypes() +898
   Microsoft.SharePoint.SPContext.get_ContentType() +472
   Microsoft.SharePoint.SPContext.get_Fields() +271
   Microsoft.SharePoint.WebControls.FormComponent.get_Fields() +44
   Microsoft.SharePoint.WebControls.FieldMetadata.get_Field() +419
   Microsoft.SharePoint.WebControls.FormField.CreateChildControls() +596
   System.Web.UI.Control.EnsureChildControls() +87
   Microsoft.SharePoint.WebControls.BaseFieldControl.OnLoad(EventArgs e) +176
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +265
   System.Web.UI.ControlCollection.Add(Control child) +80
   System.Web.UI.Control.AddParsedSubObject(Object obj) +41
   Microsoft.SharePoint.WebPartPages.WebPart.AddParsedSubObject(Object obj) +1149
   Microsoft.SharePoint.WebPartPages.DataFormWebPart.CreateChildControls() +1267
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +44
   System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean  includeStagesAfterAsyncPoint) +842

I have tried the solution from this site to enable the subsite to access top level site list.

Is this a bug? Any help would be appreciated.

© Stack Overflow or respective owner

Related posts about sharepoint

Related posts about masterpage