J
Joey
Can someone provide an example of how to link in a javascript source
file into the master page of my asp.net 2.0 web application? In asp.net
1.1 I always used the following line of code in each individual page...
<script language="javascript" type="text/javascript"
src="../../MyScripts.js"></script>
However, when I try to use it in a master page in asp.net 2.0, the src
attribute does not map
properly.
src="MyScripts.js" doesn't work, unless you're on a page in the site
root folder.
src="~/MyScripts.js" doesn't work, either.
src="/MyScripts.js" works as long as you deploy and hit
"http:\\localhost" from IIS.
But I am trying to run in file system mode. I have also seen this
mapping problem with some HTML controls that I using (images, etc...).
One cannot and should not always use a server control.
What should I do?
file into the master page of my asp.net 2.0 web application? In asp.net
1.1 I always used the following line of code in each individual page...
<script language="javascript" type="text/javascript"
src="../../MyScripts.js"></script>
However, when I try to use it in a master page in asp.net 2.0, the src
attribute does not map
properly.
src="MyScripts.js" doesn't work, unless you're on a page in the site
root folder.
src="~/MyScripts.js" doesn't work, either.
src="/MyScripts.js" works as long as you deploy and hit
"http:\\localhost" from IIS.
But I am trying to run in file system mode. I have also seen this
mapping problem with some HTML controls that I using (images, etc...).
One cannot and should not always use a server control.
What should I do?