Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my inline asp.net not working within <link href>?

I want to add a version number to my js files.

<link href="css/reset.min.css?v=<%= App.Golbal.VERSION %>" media="all" rel="Stylesheet" type="text/css" />

This renders as

<link href="css/reset.min.css?v=&lt;%= App.Golbal.VERSION %>" media="all" rel="Stylesheet" type="text/css" />

[Standard asp.net 4 web applciation]

Can anybody help?

like image 341
Andrew Avatar asked Mar 09 '11 16:03

Andrew


1 Answers

Put it inside PlaceHolder control because link in the title not included in the form tag so no parsing will occur to it as following

<asp:PlaceHolder runat="server">
<link href="css/reset.min.css?v=<%= App.Golbal.VERSION %>" media="all" rel="Stylesheet" type="text/css" />
</asp:PlaceHolder>
like image 198
M.Ramadan Avatar answered Sep 19 '22 14:09

M.Ramadan