I'm having headaches when trying to host MVC 2 on XP IIS! (This applies to VS 2008, but probably applies to VS 2010.)
After much fighting, I finally found a way to display my MVC 2 from IIS 5.1, but the problem is that there is no style! Any ideas on how I should fix this?
The problem is probably the location of the path. Following the recommendations of the link above, if I change the relative path of my CSS link from <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />to <link href="%3C%=Url.Content%28" ~="" content="" site.css="" )="" %>="" rel="stylesheet" type="text/css" />, then it does not do any conversion. When I change it to <link href="<%=Url.Content(" ~="" content="" site.css="" )="" %>="" rel="stylesheet" type="text/css" />, I get the error "New line in constant".
EDIT: Normal <link href="<%= Url.Content("~/Content/Site.css")%>" rel="stylesheet" type="text/css" />translates to <link href="/Mvc2.VS2008/Content/Site.css" rel="stylesheet" type="text/css" />(where Mvc2.VS2008is my site root), but was Content/Site.cssnot found when placing this path.
source
share