Ishika
Ishika

Reputation: 145

Regarding error in redirecting page to another. Asp.net c#

Hi I got this error when I was redirecting to other page in asp.net as follows : "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." What exactly does this error mean? Thank You.

Upvotes: 0

Views: 1674

Answers (4)

Gabriel G
Gabriel G

Reputation: 700

The problem in my case was that I had two nested web.config files as follows:

path: root\folder1\

 <deny users="*"/>

path: root\folder1\folder2\

 <deny users="?"/>

I deleted that part of the config file in folder2 and the problem was corrected

Thanks

Upvotes: 0

Bhavik Goyal
Bhavik Goyal

Reputation: 2796

this error occurs when you have the response.redirect in the infinity loop.

For example you have two pages default1.aspx and other is default2.aspx

and defautl1.aspx redirects to default1.aspx and same is done by default2.aspx, which redirects to default1.aspx.

this is the state.

In your case under such specific condition if condition this might be behacing in such a manner and this condition might have occured.

Please check your code.

Upvotes: 0

curtisk
curtisk

Reputation: 20175

What it means is that your Response.Redirect() sequence keeps sending redirects to the client where it is volleying between two pages which redirect to each other. At least that's what Firefox is inferring. Post some of your code and we may be able to find out exactly what is going on.

Upvotes: 0

m.edmondson
m.edmondson

Reputation: 30872

Theres a high chance that whatever page you are redirecting to, is redirecting itself in such a way that you get a "redirection loop" that will never reach completion.

I find this is most common when an exception handler Response.Redirect()'s to an error page which itself causes an exception. Therefore the browser just gets a bunch of HTTP 3xx responses for each page it requests and reports the error you're describing (whereas IE will just carry on regardless).

Upvotes: 5

Related Questions