【发布时间】: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 忽略
<system.webServer> -
嗨 - 你解决了这个问题吗?