There's a new HtmlLink class that writes the link element into the head but
there does not appear to be an equivalent for writing a script element into
the head. I'm using this...
#region Write JavaScript <script> Element External File Reference...
// Define an arbitrary but unique name to use as a key
String key = "ExternalJavaScriptReference";
String url = Request.ApplicationPath + "/Scripts/scripts.js";
// Instantiate ClientScript object
ClientScriptManager cs = Page.ClientScript;
// Do not register if this instance of the key is already registered
already.
if (!cs.IsClientScriptIncludeRegistered(key))
{
// Write <script> element into body of the page
cs.RegisterClientScriptInclude(key, url);
}
#endregion
That writes the <script> element into the body and as far as I can tell
provides the same functionality as it were in the head noting I'd like to
know the difference if any.
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL
http://metromilwaukee.com/
URL
http://clintongallagher.metromilwaukee.com/