Using tilde in script tag src attribute Using tilde in script tag src attribute asp.net asp.net

Using tilde in script tag src attribute


I'm not sure there is a way to get it to work correctly without a bit of assistance. This should work, not as nice as the link though:

<script src="<%=ResolveUrl("~/Scripts/jquery-1.8.2.min.js")%>"></script>


Unfortunately, what you want just doesn't work (although I agree it should).

If you are using a script manager, then you can do something that is reasonably close:

<asp:ScriptManager>   <Scripts>      <asp:ScriptReference Path="~/Scripts/jquery-1.8.2.min.js" />   </Scripts></asp:ScriptManager>