![](/img/trans.png)
[英]how to replace space with hyphen '-' in asp.net Url routing while passing parameter from html (.aspx) page
[英]MapRequestHandler - 404.0 Error when routing .html from .aspx in IIS 8.0
我在Asp.net
框架4.0中使用URL重寫,我正在使用html擴展替換aspx(即我使用像Login.aspx這樣的路由作為Login.html)。 但它顯示錯誤404 (未找到)錯誤。 簡而言之,擴展名為.html的URL重寫在IIS 8.0上不起作用。 沒有.html(如登錄時使用Login.aspx),它運行正常。
檢查一下:
theprojectjugaad.com/Login.html (404.0誤差)
請幫我解決這個問題。
Global.asax中
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes();
}
private static void RegisterRoutes()
{
System.Web.Routing.RouteTable.Routes.Add(
"Login", new System.Web.Routing.Route("Login.html",
new DisplayRouteHandler("~/Login.aspx")));
}
將應用程序池從Classic更改為Integrated修復了該問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.