When writing ASP.NET Web Forms, the basic rules for using ResolveClientUrl in master pages are:
<img src="<%= ResolveClientUrl("~/x/resource.jpg")%>" />
<script src="<%= ResolveClientUrl("~/x/resource.js")%>"></script>
If you want to use ResolveClientUrl in the master page <head> section for script tags:
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
<script src="<%= ResolveClientUrl("~/x/resource.js")%>"></script>
</asp:PlaceHolder>
You do not need to use ResolveClientUrl for CSS link elements in the <head> section (they will automatically be resolved by ASP.NET).
No comments:
Post a Comment