Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link relative to Application root with client tag

Tags:

asp.net

Is there any way to link to the application root with the ~ character (or something similar) in a client tag (e.g. <link>)? I have some external stylesheets and scripts that I need to link to in a Master page, but I don't want to hardcode the path relative to the IIS site, I want to do it based on the relative application path.

like image 286
Kyle Avatar asked Aug 17 '11 15:08

Kyle


1 Answers

Yes, use <link href="<%= ResolveUrl("~/meep/moop.css") %>" />.

Not the prettiest of solutions, but you should only use it a couple of times during development...

like image 190
Blindy Avatar answered Oct 20 '22 08:10

Blindy