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 would like to add a new custom-defined DelegateControl to the bottom of my MasterPage so that I can install Google Remarketing markup to the bottom of all my pages with a Feature. I already have the feature and usercontrol deployed and activated, but it's not showing up in the DelegateControl tag that I've created. This feature also installs Google Analytics markup to the pre-existing AdditionalPageHead and is doing so correctly, so there must be some step missing in making SharePoint acknowledge my custom-defined DelegateControl.

The control is declared in my MasterPage thusly:

<SharePoint:DelegateControl ControlId="RIMS2_PageFooter" Id="RIMS2PageFooter" runat="server" AllowMultipleControls="true"/>

and the "elements.xml" file for that particular feature thusly:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Control Id="AdditionalPageHead" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Analytics.ascx" />
    <Control Id="RIMS2_PageFooter" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Remarketing.ascx" />
</Elements>
share|improve this question
2  
After much googling, researching, reading and testing, I finally found out that, apparently, this was a two-sided issue: One being that substituting content using custom DelegateControls doesn't actually work in WSS 3.0 (my local development environment. Production environment is MOSS 2007) and secondly, the ControlId parameter doesn't allow numbers within the string (not that it generated an error to that effect). –  vynsane Nov 6 '12 at 3:54
    
You should post your resolution as an answer and mark it as such so this question can be closed. –  John Chapman Feb 15 '13 at 19:47
add comment

1 Answer

up vote 0 down vote accepted

I resolved this by changing the ControlId and Id parameters to strings that didn't include numbers like so:

   <SharePoint:DelegateControl AllowMultipleControls="true" ControlId="RIMS_PageFooter" ID="RIMSPageFooter" runat="server"/>

and setting the Id in the elements.xml file to reflect that change:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
        <Control Id="AdditionalPageHead" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Analytics.ascx" />
        <Control Id="RIMS_PageFooter" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Remarketing.ascx" />
</Elements>

I was also mistaken regarding WSS not displaying custom DelegateControls - the Google Remarketing tags are showing up correctly in the pages at the root of the WSS site, where the MasterPage has been edited to include the custom DelegateControl. It is, however, not showing up on other pages because one would need to modify the MasterPage of each subweb to contain the same DelegateControl tag (uncovering one of the hidden benefits of the Publishing Services in MOSS).

share|improve this answer
add comment

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.