我正在尝试在我的asp.net mvc项目中路由.aspx(webforms页面).我在global.asax中注册页面:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapPageRoute("Tickets", "Reports/Tickets", "~/WebForms/Reports/Tickets.aspx");
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
Run Code Online (Sandbox Code Playgroud)
问题是,在我添加第二行之后,站点停止进入我的Home Controller(索引操作)并重定向到:http://localhost:37538/Reports/Tickets?action=Index&controller=Login%22始终我运行项目.
项目详情:
Obs:要重现此错误,请在创建文件夹中的Ticketswebforms页面后,创建一个新的asp.net mvc项目作为Internet应用程序/WebForms/Reports,并注册新路由.运行项目(可能你已经记录),所以现在注销,你将被重定向到http://localhost:35874/Reports/Tickets?action=LogOff&controller=Account,为什么呢?