Here's what I used...
<head runat="server">
<script src="<%= Request.ApplicationPath %>/Scripts/scripts.js"
type="text/JavaScript"></script>
</head>
That raises this error...
The Controls collection cannot be modified because the control contains code
blocks (i.e. <% ... %>).
Catch-22...
This HTML web server control -- <head runat="server"> -- is raising the
exception and we can not remove runat="server" from the head element when
using 2.0 Themes. Thus, we can not use ServerVariables with expressions to
dynamically assign a path or we have to remove runat="server" and stop using
Themes. Nice choice.
A Page_Load Solution...
#region Write External JavaScript Library <script> Declaration...
// Dynamically assign path to external Javascript library src
attribute
// by writing <script...></script> into the body of the page
// obviating the need for <script...></script> to be located in
the
// <head> element which imposes conflict when using Themes.
// Define an arbitrary but unique name to use as a key
String key = "ExternalJavaScriptReference";
String url = Request.ApplicationPath + "/Scripts/scripts.js";
// Instantiate ClientScriptManager object
ClientScriptManager cs = Page.ClientScript;
// Do not register if this instance of the key is already
registered.
if (!cs.IsClientScriptIncludeRegistered(key))
{
cs.RegisterClientScriptInclude(key, url);
}
#endregion
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL
http://metromilwaukee.com/
URL
http://clintongallagher.metromilwaukee.com/
"Flip" <ph******@hotmail.com[remove]> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
SHOOT! :> Hit the send button prematurely. :< Did you surround your <%=
with quotes?
Something like this.
<script
language="Javascript"
type="text/javascript"
src="<%=Request.ApplicationPath()%>/ButtonHandlers.js">
</script>
I'm going from memory, but I HTH. Good luck.