Response.Redirect causes an exeception

W

Waldy

Hi there,
I have a very simple three page web application that I am
having trouble with. If there are any problems with any of the parameters
that are passed to the first page, I want to redirect to an error page and
display a message. However, when I call Response.Redirect, I get an
exception "Thread was being aborted". I have set the EndResponse parameter
set to true. The first page does not actually have any output, could that
be something to do with it?

Thanks.
 
M

Mark Fitzpatrick

There's nothing wrong. When the response redirects, it aborts the processing
of the first page and sends the 302 redirect to the browser. That's normal
and prevents the first page from going on it's merry way.
 
W

Waldy

Mark Fitzpatrick said:
There's nothing wrong. When the response redirects, it aborts the
processing of the first page and sends the 302 redirect to the browser.
That's normal and prevents the first page from going on it's merry way.

Hi Mark,
so I cannot call Response.Redirect in a try catch block?

Regards,

Waldy.
 
A

Aidy

This situation can cause issues when you have a redirect inside a try block
though. At least I think that's the issue.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top