473,394 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

HttpHandler and Response.Redirect

Jed
I have written an HttpHandler which I invoke through an ashx page.

The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page.

Everything up to the redirect works fine, but I can't get the redirect to work.

If I do a ...
context.Response.Write("Hello World");
.... the HttpHandler works great and the browser loads the text fine,
but if I change it to ...
context.Response.Redirect("/filepath/file.htm");
.... the browser just spins and spins like it is trying to load something but nothing every does.

The redirect URL does show up in the status bar, and the URL is valid, but nothing ever loads!

I have tried Server.Transfer and Server.Execute and they exhibit the same behavior. Does anybody know what might be going on?
Nov 18 '05 #1
3 7914
Stupid question here, have you tried loading file.htm manually ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jed" <Je*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
I have written an HttpHandler which I invoke through an ashx page.

The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page.
Everything up to the redirect works fine, but I can't get the redirect to work.
If I do a ...
context.Response.Write("Hello World");
... the HttpHandler works great and the browser loads the text fine,
but if I change it to ...
context.Response.Redirect("/filepath/file.htm");
... the browser just spins and spins like it is trying to load something but nothing every does.
The redirect URL does show up in the status bar, and the URL is valid, but nothing ever loads!
I have tried Server.Transfer and Server.Execute and they exhibit the same behavior. Does anybody know what might be going on?

Nov 18 '05 #2
Check this out...

http://pubs.logicalexpressions.com/P...cle.asp?ID=214

....as it may be that the use of the HttpHandler may be where the
conflict is occurring with the way the Response.Redirect actually
functions when it imputes metadata into the header of the response.
--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/



"Jed" <Je*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
I have written an HttpHandler which I invoke through an ashx page.

The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page.
Everything up to the redirect works fine, but I can't get the redirect to work.
If I do a ...
context.Response.Write("Hello World");
... the HttpHandler works great and the browser loads the text fine,
but if I change it to ...
context.Response.Redirect("/filepath/file.htm");
... the browser just spins and spins like it is trying to load something but nothing every does.
The redirect URL does show up in the status bar, and the URL is valid, but nothing ever loads!
I have tried Server.Transfer and Server.Execute and they exhibit the same behavior. Does anybody know what might be going on?

Nov 18 '05 #3
Jed
Yep. The page does load manually.

One thing I left out, which has now become relevant is that I am initiating the call to the HttpHandler through a post from an acrobat pdf file.

I tried posting to the handler from an html form and the redirect works fine. So I guess it has something to do with the post from the pdf, though I have no clue why it would make a difference.

I tried declaring the Response.ContentType in the HttpHandler to make sure there wasn't any confusion about the Response there, but that didn't work.

It's still weird that Response.Write works but redirect doesn't. And also weird that I can't use Server.Execute with Response.Write to output the confirmation page. No attempt to get to that file from the HttpHandler works if the post if from a pdf.

"One Handed Man ( OHM - Terry Burns )" wrote:
Stupid question here, have you tried loading file.htm manually ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Jed" <Je*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
I have written an HttpHandler which I invoke through an ashx page.

The HttpHandler does various things to process the request, then it is

supposed to redirect to a confirmation page.

Everything up to the redirect works fine, but I can't get the redirect to

work.

If I do a ...
context.Response.Write("Hello World");
... the HttpHandler works great and the browser loads the text fine,
but if I change it to ...
context.Response.Redirect("/filepath/file.htm");
... the browser just spins and spins like it is trying to load something

but nothing every does.

The redirect URL does show up in the status bar, and the URL is valid, but

nothing ever loads!

I have tried Server.Transfer and Server.Execute and they exhibit the same

behavior. Does anybody know what might be going on?


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dale Ragan via .NET 247 | last post by:
(Type your message here) -------------------------------- From: Dale Ragan I am running into a problem with an HttpHandler that I have builtto show a progress image on the page getting...
6
by: Sam | last post by:
My problem is that when I am trying to use Server.Execute("Somehandler.ashx") I am getting HttpException. System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer,...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
2
by: MilanB | last post by:
Hello, I created HttpHandler to redirect root Default.aspx. But I don't know how to create path, that will redirect just web root Default.aspx. I tried following line, but it redirects all...
0
by: Mike Lowery | last post by:
I've written an HTTPHandler based on the article at http://msdn2.microsoft.com/en-us/library/ms228090.aspx. It's working, but I have one problem. What I'm trying to do is redirect the browser...
5
by: hawkeye parker | last post by:
Hello, IIS 6.0 server, .Net 2.0. I have a file download architecture which redirects file download requests to a custom server-side HttpHandler. The handler gets a stream over the file and...
6
by: Mike | last post by:
Hi, I have a problem of page redirection. Basically, the user has to connect to the local web server, but some pages need to be served by a remote server, because it contains some confidential...
5
by: zlf | last post by:
Hello, I try to use a custom HttpHandler to add something to session, then display the original page. public void ProcessRequest(HttpContext context) { context.Session = "test"; } But, a...
5
by: Author | last post by:
I followed the example at http://support.microsoft.com/kb/308001/EN-US/ and created my own HttpHandler. Here is the code: using System.Web; namespace MyNameSpace { public class...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.