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

We have a solution with WSP package.

This contains set on Delegate Controls. I want to use one of the Delegate Control with multiple parameters. Hence, I have copied that code related to that and renamed that to a different name and trying to access that control.Here is the code for that.

 <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
                                    <Template_Controls>
                                    <asp:SiteMapDataSource
                                    ShowStartingNode="False"
                                    SiteMapProvider="SWLMySiteSiteMapProvider"
                                    id="topMySiteMap"
                                    runat="server"                                     
                                    StartingNodeUrl="sid:1002"/>                                        
                                    </Template_Controls>
                            </SharePoint:DelegateControl>

Here is the code for the elements.xml

 <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Control Id="MySiteTopNavigationDataSource" Sequence="21"
          ControlClass="System.Web.UI.WebControls.SiteMapDataSource"
          ControlAssembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">    
    <Property Name="ID">topMySiteMap</Property>
    <Property Name="SiteMapProvider">SWLMySiteSiteMapProvider</Property>
    <Property Name="ShowStartingNode">True</Property>
  </Control>
</Elements>

Here is the code for the Projectitemdata.spdata.

<?xml version="1.0" encoding="utf-8"?>
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.GenericElement" DefaultFile="Elements.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site, WebApplication, Farm, Package" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
  <Files>
    <ProjectItemFile Source="Elements.xml" Target="SWLMySiteTopNavDataSourceDelegate\" Type="ElementManifest" />
  </Files>
</ProjectItem>

When I try to access the page, I get the following error.

Could not find the sitemap node with URL 'sid:1002'.

share|improve this question

1 Answer 1

Most likely the problem lies in the site definition's ONET.XML in the NavBars section. The NavBar with ID 1002 is missing. You might also encounter errors when editing navigation as described here: Unable to modify navigation heading link.

I also recommend that you read this: Charlie Holland's NavBars - if only it was that simple!

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.