ASP.NET 4.0 Web Form Routing to Windows Server 2003 IIS 6.0

I am trying to run web form routing in asp.net 4.0 on IIS 6.0, but I keep getting 404 page.

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

in my 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>

And I also tried to set up wildcard matching for the site. Path = C: \ WINDOWS \ Microsoft.NET \ Framework \ v4.0.30319 \ aspnet_isapi.dll Uncheck "check if file exists"

Any clue on what I might be doing wrong?

thank

+3
source share
1 answer

I am doing the same on XP (IIS6), but without these web.config parameters and handler settings. I believe this is for AppFabric settings or something else.

At the bottom of my creation routes, I also:

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

. , .

/ IIS, , .

0

Source: https://habr.com/ru/post/1783162/


All Articles