Search code examples
sharepointsharepoint-2010

Sharepoint includes control template twice


I'm working on a SharePoint 2010 project. We have a usercontrol to include all of our custom javascript. I popped an alert in there whilst debugging something else, and lo and behold the alert was called twice. I checked and the file in question is included by only one Elements.xml file in one feature. So how can this be? I've tried searching the whole solution, and I only get one hit, so I must be missing something.

EDIT:

This is the code calling the User Control:

<Control Id="AdditionalPageHead" Sequence="10" ControlSrc="/_controltemplates/company/UCLoadJS.ascx" />

This code is found in the Elements.xml of the MasterPages folder, which deploys our custom master page. Having searched the whole project for UCLoadJS, I cannot find another instance.


Solution

  • I think you have hidden WPs loading these Controls. Try creating a new page and add the Visual WP once and try again