ASP.NET Routing - Do Custom Routes COMPLETELY SKIP Everything in the Global.asax?

后端 未结 4 844
无人及你
无人及你 2020-12-18 13:11

I have a simple ASP.NET 3.5 SP1 Web Forms app... I\'ve added the System.Web.Routing DLL, and I\'ve made a simple route that returns a standard ASP.NET Page as the \"IHttpHan

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 13:54

    Assuming you're using IIS6, the alternative is to define a "wild card" extension handler. Adding this simple "catch all" mapping to IIS6 will enable it to process your extensionless requests. By default, the .NET installer maps ".aspx" to the aspnet_isapi.dll- that's why the .aspx extension works. To map requests with no extension to the APS.NET engine, you must tell IIS to look at every request.

    Here's a quick article that explains the process:

    http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

    Hope that helps and reduces the "lame" factor of your URLs. :)

    -Todd

提交回复
热议问题