【问题标题】:ASP.NET 4.0 web form Routing on IIS 6.0 windows server 2003IIS 6.0 windows server 2003 上的 ASP.NET 4.0 Web 表单路由
【发布时间】:2011-06-02 16:28:59
【问题描述】:

我正在尝试在 IIS 6.0 上的 asp.net 4.0 中运行 Web 表单路由,但我不断收到 404 页面。

protected void Application_Start(object sender, EventArgs e)
{
    System.Web.Routing.RouteTable.Routes.MapPageRoute
       ("testRoute", "test/{param}", "~/testing.aspx");
}

在我的 web.config 中

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true">
   <remove name="UrlRoutingModule"/>
   <add name="UrlRoutingModule" 
        type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, 
              Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </modules>
  <handlers>
   <add 
     name="UrlRoutingHandler" 
     preCondition="integratedMode" 
     verb="*" path="UrlRouting.axd" 
     type="System.Web.HttpForbiddenHandler, System.Web,  
          Version=2.0.0.0, Culture=neutral,  
          PublicKeyToken=b03f5f7f11d50a3a"/>
  </handlers>
 </system.webServer>

我还尝试为网站设置通配符映射。 路径 = C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll 取消勾选“验证文件是否存在”

关于我可能做错了什么的任何线索?

谢谢

【问题讨论】:

  • IIS 6 忽略 &lt;system.webServer&gt;
  • 嗨 - 你解决了这个问题吗?

标签: routing webforms iis-6


【解决方案1】:

我在 XP (IIS6) 上做同样的事情,但没有那些 web.config 模块和处理程序设置。我相信这些是用于 AppFabric 设置或其他的。

在我的创建路线的底部我也有:

routes.MapPageRoute("Default", "", "~/Default.aspx", false);

默认页面。这可能也是你需要的。

还要检查 IIS 中的添加/删除窗口组件,看看是否选中了路由。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-29
    相关资源
    最近更新 更多