I'm getting headaches from trying to host MVC 2 on XP's IIS! (This is on VS 2008, but probably applies to VS 2010 as well.)
After much struggling I eventually found a way to display my MVC 2 site from IIS 5.1, but the problem is that there is no styling! Any ideas on how I should fix this?
The problem is probably the path location. Following the suggestions from 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 conversions. When I change it to <link href="<%=Url.Content(" ~="" content="" site.css="" )="" %>="" rel="stylesheet" type="text/css" />
then I get the error "Newline in constant."
EDIT: The 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.VS2008
is my website root), but Content/Site.css
is not found when hosted this way.