0

I am using the simple code to do URL Re-writing in a web based application.

Here is my global files code:

void Application_Start(object sender, EventArgs e) 
{
    // Code that runs on application startup
    RouteTable.Routes.MapPageRoute("Login", "Admin/LoginPage", "~/Admin/login.aspx");

}

I have added the following lines in Web.config file also:

 <httpModules>
  <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"></add>
</httpModules>

I Dont know why this is not working for me. Please help me..

4

2 回答 2

0

您是否在 IIS 中安装了 URL 重写扩展?

于 2013-02-11T08:03:40.767 回答
0

我猜您将模块添加到错误的位置(<system.web>/<httpModules>)。

如果您以集成管道模式在 IIS 中托管应用程序,则应将模块添加到<system.webServer>/<modules>节点:

<system.webServer>
    <modules>
        <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"></add>
    </modules>
</system.webServer>
于 2013-02-11T08:19:31.167 回答