I have two SharePoint features, each implemented identically (see below) that add controls to the delegate control in the header of my pages. One of the controls depends on the other (one of them is the jQuery library, and the other depends on jQuery), however, when the controls are displayed, the order of the controls is incorrect. How do I specify the order in which these controls are displayed?
Control (both are identical, except that they link to another .js file):
<%@ Control ClassName="MyScriptControl" %>
<script type="text/javascript" src="/_layouts/MyScript.js"></script>
feature.xml:
<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="AA9D59AC-D53E-4338-9B52-CD39F2A8C31A"
ActivateOnDefault="true"
Title="My Feature"
Description="Does something."
Scope="Site" Version="1.0.0.0"
Hidden="FALSE"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="MyFeature\Elements.xml" />
</ElementManifests>
</Feature>
Elements.xml:
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"
Id="24A4BB9A-9636-4a73-B3A5-35661DE19902">
<Control Id="AdditionalPageHead"
ControlSrc="~/_controltemplates/MyControl.ascx" />
</Elements>
The output on the page (jQuery expanded to DependsOnjQuery):
<script type="text/javascript" src="/_layouts/DependsOnjQuery.js"></script>
<script type="text/javascript" src="/_layouts/jQuery.min.js"></script>
I want MyControl1.js to appear before MyControl2.js.