ASP.NET 4.0, IIS 7.5, URL Routing: Infinite Loop when no page is specified
I've got a very simple app built in ASP.NET 4.0 which is using URL Routing. There are only two forms: Default.aspx and SubPage.aspx. It's not an MVC app. Just normal ASP.NET. When I simulate (debug) the app, it works beautifully. But if I execute the app via IIS 7.5 it all works great UNLESS I don't specify a file, in which case it hangs in the browser because of an infinite redirect loop.
In Global.asax:
开发者_开发知识库void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("SacredHeart", "{ParentPage}/{ChildPage}", "~/SubPage.aspx", false, new RouteValueDictionary { { "ParentPage", "home" }, { "ChildPage", "default" } });
}
This works fine:
http://dev.sacredheart.com/rshm_life/Where_We_Are
But this results in an infinite redirect loop:
http://dev.sacredheart.com
I tried adding:
routes.MapPageRoute("SacredHeartHome", "", "~/Default.aspx");
but that didn't solve anything. I've been looking all over but I can't find anyplace where someone posted this problem before. I'm sure the solution if simple, but I can't seem to find it.
I'm at a bit of a loss here. Anyone got any ideas?
精彩评论