Response.Redirect

K

Kerri

Hi,

I have do some Redirects in my applitcaion.

For example, when the use rhas logged in successfully I
redirect them to a different page.

In my Redirect all I was doing was a..

Response.Redirect("SomePage.aspx")

When I used above I got below error.

2) Exception Information
*********************************************
Exception Type: System.Threading.ThreadAbortException
ExceptionState:
System.Web.HttpApplication+CancelModuleException
Message: Thread was being aborted.
TargetSite: Void AbortInternal()
HelpLink: NULL
Source: mscorlib

StackTrace Information
*********************************************
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean
endResponse)
at System.Web.HttpResponse.Redirect(String url)



I have now changed all my Redirects to be..

Response.Redirect("MyPage.aspx", False)

I use False everywhere as I don't want to ever end the
execution of my page.

I have 2 questions-:

(i) Why was I getting above error. Do I have to pass in a
boolean also to my Response.Redirect?
(ii) When would I use True. Surely I will never want to
finish executing the page I am on so it will always be
False???

Any advice on this is much appreciated.
 

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

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top