I am using the latest version of MVCContrib and attempting to include a stylesheet via the following helper method:
<%=Html.Stylesheet(Links.Content.Site_css)%>
The path rendered is incorrectly calculated as:
<link type="text/css" rel="stylesheet" href="/content/css/Content/Site.css" />
The actual path should be: /Content/Site.css
Is this a bug?
The following methods work correctly:
METHOD 1: <%=Html.Stylesheet("~/Content/Site.css")%>
METHOD 2: <link type="text/css" rel="stylesheet" href="<%:Links.Content.Site_css %>" />
UPDATE 1:
Links.Content.Site_css represents a static field that is auto-generated using T4MVC
UPDATE 2: Here is what the code generated by T4MVC looks like...
namespace Links {
...snipped for brevity...
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public static class Content {
private const string URLPATH = "~/Content";
public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); }
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); }
public static readonly string Site_css = Url("Site.css");
}