Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Response.Redirect causes an exeception

Reply
Thread Tools

Response.Redirect causes an exeception

 
 
Waldy
Guest
Posts: n/a
 
      11-15-2007
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.


 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      11-15-2007
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.


--

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression

"Waldy" <> wrote in message
news:...
> 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.
>



 
Reply With Quote
 
 
 
 
Waldy
Guest
Posts: n/a
 
      11-15-2007
"Mark Fitzpatrick" <> wrote in message
news:%...
> 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.


 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      11-15-2007
"Waldy" <> wrote in message
news:%23J%...

> so I cannot call Response.Redirect in a try catch block?


You can, but the "usual" way is to use the boolean overload:
http://msdn2.microsoft.com/en-us/lib...dt(vs.80).aspx


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
Aidy
Guest
Posts: n/a
 
      11-15-2007
This situation can cause issues when you have a redirect inside a try block
though. At least I think that's the issue.

"Mark Fitzpatrick" <> wrote in message
news:%...
> 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.
>
>
> --
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - Expression
>
> "Waldy" <> wrote in message
> news:...
>> 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.
>>

>
>



 
Reply With Quote
 
Waldy
Guest
Posts: n/a
 
      11-15-2007

"Mark Rae [MVP]" <> wrote in message
news:...
> "Waldy" <> wrote in message
> news:%23J%...
> You can, but the "usual" way is to use the boolean overload:
> http://msdn2.microsoft.com/en-us/lib...dt(vs.80).aspx


I am using the parameter, but set to true. What is the default if it is not
specfied?


 
Reply With Quote
 
Waldy
Guest
Posts: n/a
 
      11-15-2007
"Mark Rae [MVP]" <> wrote in message
news:...
> "Waldy" <> wrote in message
> news:%23J%...
>
>> so I cannot call Response.Redirect in a try catch block?

>
> You can, but the "usual" way is to use the boolean overload:
> http://msdn2.microsoft.com/en-us/lib...dt(vs.80).aspx


Setting the parameter to false, stops the exception.

Thanks.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Security Exeception during upgrade SteveWestling ASP .Net Security 2 11-20-2005 09:30 PM
Belkin wireless card causes XP to freeze Ian Wireless Networking 5 04-03-2005 10:36 PM
USR2216 WiFi card causes Win XP to crash - newbie need help! David Leslie Wireless Networking 3 01-22-2005 05:17 PM
Roaming causes database to drop connection Dave Ploch Wireless Networking 4 11-18-2004 10:59 PM
Postback causes 100=Continue, causes double download prompt? Xavier Osa ASP .Net 0 01-09-2004 11:17 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57