开发者

URL Routing in ASP.net 3 Web Forms with IIS7

I am using Web Forms ASP.Net Framework 3.5 I have built a website which is running fine on IIS6. I have added routes for it which are running fine aswell. It required me to do some changes in Web.Config and add some co开发者_C百科de in global.asax which is below

    protected void Application_Start(object sender, EventArgs e)
    {
        RegisterRoutes(RouteTable.Routes);
    }

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.Add("Login", new Route("User/Login", new RoutingHandler("~/pages/Users/Login.aspx")));
        routes.Add("Products", new Route("Pages/Products/{Category}", new RoutingHandler("~/Products/Default.aspx")));
    }

And its working fine when I access /user/login OR /products/mobile etc

But This doesn't work on IIS7.5. There it simply gives 404 error when I access any route. How to fix this? Do I need to make any changes to run it in IIS7.5?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜