My question is regarding a delegate control called TopNavigationDataSource, normally when you create a delegate control you just define there some new properties etc.
But what if I want to deploy delegate control with user control? I did it this way:
<Control Id="TopNavigationDataSource" Sequence="10" ControlSrc="~/_controltemplates/CustomNavUserControl.ascx">
</Control>
In CustomNavUserControl.ascx i put following:
<asp:SiteMapDataSource ShowStartingNode="False" SiteMapProvider="MySiteMapProvider"
id="topSiteMap" runat="server" StartingNodeUrl="sid:1002"/>
But when deploying it i get an error saying:
System.Web.HttpException: The DataSourceID of 'TopNavigationMenuV4' must be the ID of a control of type IHierarchicalDataSource. A control with ID 'topSiteMap' could not be found.
What is ofcourse not true as i have just above the delegate in master page the following:
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
SkipLinkText=""
CssClass="s4-tn" Width="16px" Height="16px"/>
What do I miss?