Response.Redirect(); doesn't work on SOME servers

  • Thread starter Thread starter mark mcfarlane
  • Start date Start date
M

mark mcfarlane

I have a simple button on a page with a
Response.Redirect("http://www.microsoft.com"); in the call back. There's
lotsof other stuff going on on the page, but not in this buttonPress method.
There's only on eline of code in the buttonpress method,
Response.Redirect(http://www.microsoft.com);

The code works perfectly on several Windows XP machines. The redirect does
not work on 2 different Windows 2003 servers.

I have tried numerous 'fixes' recommended by people (flushing and closing
the response object, using the true/false version, putting it in a try
block, removing it from a try block,....) Nothing makes a difference,

Server.Transfer("url"); gets around the problem, but I don't like it because
the URL is now wrong in the browser window. Also, like most programmers, a
'fix' just isn't enough, I have to understand WHY this isn't working
correctly or I can't sleep, my hair will fall out, ....

Anyone else have an idea?

This must be a configuration setting for IIS, or a bug in IIS 6.0 and the
ASP.NET version on my deployment web server.

Mark McFarlane
 
Mark,
Is this the only functionality that is lost? Have you confirmed that
the code is being hit, via Tracing or a Response.Write

I ask because I have had problems with related to form validation bug,
where page validation never allows a form to postback, because the JS
validation ASP.NET uses is always blocks the submit event.

This is only relavent if you are using the validator Controls on your
webform.

I mention it because it was a 2003 box where I first saw this problem.

If this does apply, here is more info on the bug:

http://scottonwriting.net/sowBlog/posts/2943.aspx
 
Is this the only functionality that is lost? Have you confirmed that
the code is being hit, via Tracing or a Response.Write

I ask because I have had problems with related to form validation bug,
where page validation never allows a form to postback, because the JS
validation ASP.NET uses is always blocks the submit event.

This is only relavent if you are using the validator Controls on your
webform.
I mention it because it was a 2003 box where I first saw this problem.

If this does apply, here is more info on the bug:

http://scottonwriting.net/sowBlog/posts/2943.aspx

The code in the line before the response.redirect is being executed (a
database save). Yes I am using validators. I tried the fix from your blog
but as I expected that didn't work either becuase my call back was occurring
and the blog fix seems to be intended to fix cases where the callback isn't
happenning.

I've had a few other really weird things happen on this Windows 2003 server
(actually, it is a Windows 2003 server hosting other virtual servers).

I'm off for a weeks vacation and then I'm going to try installing the Win
2003 SP 1 and reinstalling the .NET Framework when I return.
 
Back
Top