HttpHandler and Response.Redirect

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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 said:
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?
 
Check this out...

http://pubs.logicalexpressions.com/Pub0009/LPMArticle.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 said:
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?
 
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.
 

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

Back
Top