This code:
<% string path = Request.ApplicationPath.ToString(); %>
<link href="<%= path %>/Content/Site.css" rel="stylesheet" type="text/css" />
Returns this:
<link href="../Views/Shared/%3C%25=%20path%20%25%3E/Content/Site.css" rel="stylesheet" type="text/css" />
Whereas I was expecting this:
<link href="/foo/Content/Site.css" rel="stylesheet" type="text/css" />
Why did my code not return the expected path? How do I set up my scripts, css files, and images to be flexible if my virtual directory changes?