trouble linking dynamically to javascript file in .master file

C

Cold Filtered

Hi,

I have a .master file page with the following in <head>

<script src="javascript/common.js" type="text/javascript" />

This works fine for any .aspx files in the same directory as the
..master file.

When I navigate to a subdirectory in the application to a .aspx file
that uses the .master file, the link to the javascript is broken.

i tried:

<script runat="server" src="~/javascript/common.js"
type="text/javascript" />

but the compiler complains.

I've using the .. runat="server" .. and .. ~/ .. feature with other
controls e.g. img, anchor etc.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top