Search code examples
asp.netmaster-pagesdelimiterhead

Asp.net delimiter <% replaced with &lt;% in head tag?


Maybe its a stupid question, but i'm having this issue in Visual Studio 2010:

in my Master page i've this code:

<head runat="server">

    <title>App Title</title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
    <link href="<%= App.RootPath %>Css/style.css" rel="stylesheet" type="text/css" />
</head>

for some strange reason the <% is changed at runtime with &lt;%

<%= App.RootPath %> works normal if put anywhere outside head tag.

Anyone has never experienced this and resolved?

UPDATE:

If i put off runat="server" in head tag, it works. But i need it.

Edit:

All of these methods work, but the problem is lack of designer support?


Solution

  • For now, i've found this workaroud; still searching for the reason of this behaviour.

    <link <%= "href=" +App.RootPath +"Css/style.css" %> rel="stylesheet" type="text/css" />