For some reason, the css link on the main web form page is becoming garbled by ASP.NET.
The page using the main page is located in / subdir 1 / subdir2 / page.aspx
Not sure why this is happening, but here is the code snippet:
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <link href="<%= MyNamespace.Helpers.UrlHelper.CssRoot %>Site.css" rel="stylesheet" type="text/css" /> <script src="<%= MyNamespace.Helpers.UrlHelper.JavascriptRoot %>jquery-1.3.2.min.js" type="text/javascript"></script> <asp:ContentPlaceHolder ID="cphHead" runat="server"> </asp:ContentPlaceHolder> </head>
Generated HTML output:
<html xmlns="http://www.w3.org/1999/xhtml" > <head><title> Untitled Page </title><link href="../../%3C%25=%MyNamespace.Helpers.UrlHelper.CssRoot%20%25%3ESite.css" rel="stylesheet" type="text/css" /> <script src="/Javascript/jquery-1.3.2.min.js" type="text/javascript"></script> </head>
Why does this work for a script tag, but it distorts the link tag and does not actually execute the code. If I change the 'link' tag as a 'script' tag (this is wrong, but for testing purposes), it creates the correct html that I would expect. Why is ASP.NET fiddling with its link tag for my Css but not the javascript script tag?
Is there anything special about the link tag so that ASP.NET thinks it needs to use it?
Kelsey
source share