I have a simple web forms application. I get the following error:
Error 310 (net::ERR_TOO_MANY_REDIRECTS):
Global.asax:
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("etusivu", "opas/{name}", "~/opas/etusivu.aspx");
}
Pageload:
protected void Page_Load(object sender, EventArgs e)
{
Response.RedirectToRoute("etusivu", new { name = "etusivu" });
}
Any ideas?
If I’m understanding the question and comments correctly: You’re registering a route that redirects to etusive.aspx, the page load in etusive.aspx redirects to that same route and you’ve created a loop.