Response.Redirect Hangs

G

Guest

We have been running into some problems where using Response.Redirect causes
the page to hang and it never actually redirects.

Here's the scenario:
User opens the page, selects an item from the drop down list and then clicks
one of a couple of buttons to send them off to another page. We do a little
bit of validation in the Event Handler and then do a Response.Redirect off to
the next page. Then the page just sits there and never redirects over to the
new page. Sometimes this will happen on the first time the button is clicked
and if you click it again it will work. And then other times things work
fine for a few clicks and then it stalls. I put in some code to write to the
event log when the Event Handler runs but before the Response.Redirect and
this code is being fired and the event is written but the page just doesn't
redirect. The server is running Server 2003 with the 2.0 Framework
installed. The website does use integrated security.
This appears to be an IE only thing because if I run the site using firefox,
there aren't any problems.

We haven't been able to duplicate these Hang's on our local development
machines (XP Pro, Visual Studio 2005, .Net Framework 2.0 app)

I've seen some other postings that said that the "Smart Navigation" setting
was the culprit but I can't find any evidence of "Smart Navigation" code in
the source of the page (but I might not be looking at the right thing).

Has anyone else seen this?
 
G

Guest

Sorry, didn't see your last couple of paragraphs before my first reply.

Smart Navigation can be turned on for your whole site with a setting in the
web.config. Did you look there?

I had exactly the problem you are talking about. It was caused by smart
navigation.
 
G

Guest

I just tried setting <pages smartNavigation="false" /> in the web.config but
that doesn't seem to have helped. I can't find any settings for Smart
Navigation in any of the page directives either.
 
G

Guest

I ran into this problem involving smart navigation. I found that smart nav
was the problem by using the View Source command in the browser after the
redirection attempt. I saw a tag with a reference to smart navigation in the
returned page. I don't remember the precise name of the tag. The problem
was fixed by turning smart nav off as you have already done. However,
looking at source of the returned page may point you toward a resolution.

I hope this helps.

Eagle.
 
G

Guest

I finally tracked down the problem with the redirects.

In some instances we were doing Response.Redirect("URL here",false) to try
and avoid the bogus System.Threading.ThreadAbort exceptions. By changing
this back to Response.Redirect("URL",True) it fixes the problem but it means
that we have to trap the ThreadAbortExceptions so that they won't bubble up.
The ThreadAbort doesn't really cause a problem, it just causes our code to
log errors that it doesn't need to. Thanks for the suggestions on what to
look for on this one though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top