trouble linking dynamically to javascript file in .master file

Discussion in 'ASP .Net' started by Cold Filtered, Feb 18, 2005.

  1. 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.
     
    Cold Filtered, Feb 18, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Friso Wiskerke
    Replies:
    1
    Views:
    418
    Paul Henderson
    Jan 12, 2006
  2. Doug McCann
    Replies:
    1
    Views:
    1,035
    William Brogden
    Aug 5, 2004
  3. Roy A.
    Replies:
    4
    Views:
    462
    Jonathan N. Little
    Mar 19, 2010
  4. Captain Paralytic

    Re: trouble linking in css file

    Captain Paralytic, Mar 19, 2010, in forum: HTML
    Replies:
    0
    Views:
    471
    Captain Paralytic
    Mar 19, 2010
  5. dorayme
    Replies:
    1
    Views:
    454
    Jukka K. Korpela
    Mar 19, 2010
Loading...

Share This Page