Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris Knowles 141 posts 222 karma points
    Dec 20, 2010 @ 15:26
    Chris Knowles
    0

    Script tags not resolving path correctly in head.

    Hi,

    I can't quite figure out why the server is not resolving the path to the js files.

    Here is my code:

    <head runat="server">
      <title><umbraco:Macro Alias="PageTitle" runat="server"></umbraco:Macro></title>
      <!-- CSS -->
      <link href="~/CSS/Styles.css" rel="stylesheet" type="text/css" /> 
      <!-- JS -->
      <script src="~/Scripts/jquery-1.3.1.min.js" type="text/javascript"></script>
      <!-- Meta Data -->
      <umbraco:Macro keywords="[$metaKeywords]" description="[$metaDescription]" Alias="MetaTags" runat="server"></umbraco:Macro>
    </head>

    What i get out is:

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>Title</title>
    <!-- CSS -->
    <link href="CSS/Styles.css" rel="stylesheet" type="text/css" />
    <!-- JS -->
    <script src="~/Scripts/jquery-1.3.1.min.js" type="text/javascript"></script>
    <!-- Meta Data -->
    <meta name="keywords" content="" /><meta name="description" content="" />
    </head>

    Can anyone explain what i'm doing wrong or why this is happening?

    Thanks

    Chris

  • Chris Knowles 141 posts 222 karma points
    Dec 20, 2010 @ 15:29
    Chris Knowles
    0

    Sorry, forgot got to put it's Umbraco 4.5.2 running on IIS6.

    Thanks

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Dec 20, 2010 @ 15:34
    Ismail Mayat
    0

    Chris,

    There is issue with using head runat server if you take that out it should work do you need the runat server?

    Regards

    Ismail

  • Chris Knowles 141 posts 222 karma points
    Dec 20, 2010 @ 15:38
    Chris Knowles
    0

    Thanks for the reply but why does it resolve the CSS files and not the javascript one?

    If i remove the runat="server" tag from the head it then doesn't resolve any of them even if i put runat=server on the css file.

    Thanks

    Chris

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Dec 20, 2010 @ 15:43
    Ismail Mayat
    0

    Chris,

    This is no doubt in your master template so you dont need the ~ and it should then resolve?

    Regards


    Ismial

  • Chris Knowles 141 posts 222 karma points
    Dec 20, 2010 @ 15:52
    Chris Knowles
    0

    Ahhh i understand now.

    Thank you!

     

Please Sign in or register to post replies

Write your reply to:

Draft