代码之家  ›  专栏  ›  技术社区  ›  Peet Brits

ASP.NET MVC 2、Windows XP和IIS 5.1

  •  3
  • Peet Brits  · 技术社区  · 15 年前

    在XP的IIS上托管MVC 2让我头疼!(这是2008年,但可能也适用于2010年。)

    经过多次挣扎,我终于 found a way 显示我的MVC 2网站从IIS 5.1,但问题是没有样式!我有什么办法可以解决这个问题吗?

    问题可能是路径位置。根据上面链接的建议,如果我更改了CSS链接的相对路径, <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> <link href="%3C%=Url.Content%28" ~="" content="" site.css="" )="" %>="" rel="stylesheet" type="text/css" /> 然后它不做任何转换。当我把它改成 <link href="<%=Url.Content(" ~="" content="" site.css="" )="" %>="" rel="stylesheet" type="text/css" /> 然后我得到错误“newline in constant”。

    编辑: 正常人 <link href="<%= Url.Content("~/Content/Site.css")%>" rel="stylesheet" type="text/css" /> 翻译为 <link href="/Mvc2.VS2008/Content/Site.css" rel="stylesheet" type="text/css" /> (何处) Mvc2.VS2008 是我的网站根),但是 Content/Site.css 以这种方式托管时找不到。

    1 回复  |  直到 15 年前
        1
  •  1
  •   Peet Brits    15 年前

    Url.Content()

    1. (Error message = "Failed to access IIS metabase")
      • cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
      • Download MetaAcl
      • Metaacl.vbs "IIS://localhost/W3SVC"
      • Metaacl.vbs "IIS://localhost/W3SVC" Everyone R
      • <authentication mode="Windows" /> web.config
      • <authorization><deny users="?"/></authorization>
    2. Configure IIS virtual folder

    推荐文章