Response.Redirect() question

  • Thread starter Thread starter Axel Dahmen
  • Start date Start date
A

Axel Dahmen

Hi,

I'm wondering what is Response.Redirect(string) equivalent to:

Response.Redirect(string,true)
- or -
Response.Redirect(string,false)
?

The MSDN Library is unclear on this.

TIA,
Axel Dahmen
 
Hi,

I'm wondering what is Response.Redirect(string) equivalent to:

Response.Redirect(string,true)
- or -
Response.Redirect(string,false)
?

The MSDN Library is unclear on this.

TIA,
Axel Dahmen

the first one:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;312063

the boolean tells the code whether to stop the response at the point of
redirect, or not. By default, it is true, so a ThreadAbortException (I
believe) is thrown behind the scenes to signal to the framework to stop
processing the last request immediately (note this is important as any
code past that point could be run if it were set to false). For the
default value of true, you don't notice the exception of course, unless
you do a redirect inside of a try...catch block. Then you'd want to use
the overloaded method passing in false for 'end response' arg.
 

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