Relative path in ASP.NET -


<head runat="server">     <meta charset="utf-8" />     <title>make games scirra software</title>     <meta name="description" content="game making construct." />     <meta name="keywords" content="game maker, game builder, html5, create games, games creator" />     <link rel="stylesheet" href="~/css/default.css" />     <link rel="stylesheet" href="~/plugins/coin-slider/coin-slider-styles.css" />     <link rel="shortcut icon" href="~/images/favicon.ico" />     <link rel="apple-touch-icon" href="~/images/favicon_apple.png" />     <script src="~/js/googleanalytics.js"></script> </head> 

renders as:

<head>     <meta charset="utf-8" />     <title>make games scirra software</title>     <meta name="description" content="game making construct." />     <meta name="keywords" content="game maker, game builder, html5, create games, games creator" />     <link rel="stylesheet" href="../css/default.css" />     <link rel="stylesheet" href="../plugins/coin-slider/coin-slider-styles.css" />     <link rel="shortcut icon" href="../images/favicon.ico" />     <link rel="apple-touch-icon" href="../images/favicon_apple.png" />     <script src="~/js/googleanalytics.js"></script> </head> 

why javascript url ~/ , not ../?

strange implementation indeed, unfortunately way asp.net handles this. here compensate:

<script src="<%=resolveclienturl("~/js/googleanalytics.js")%>"></script> 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -