473,382 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Response.Redirect

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.


Jul 21 '05 #1
2 3627
..Redirect has two overloads, which you've specified. I've
gotten the error that you've indicated when I try to step
into the call when I'm debugging, but not when it executes
normally.

-----Original Message-----
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+CancelModuleExceptio n
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, BooleanendResponse)
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.


.

Jul 21 '05 #2
I've run across this before- the exception you are dealing
with can best be thought of not as an error but as a
notification that request processing is ending because the
user is being redirected. It's completely safe to just
ignore it.
-----Original Message-----
..Redirect has two overloads, which you've specified. I'vegotten the error that you've indicated when I try to step
into the call when I'm debugging, but not when it executesnormally.

-----Original Message-----
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+CancelModuleExcepti on
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 aboolean 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.


.

.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
4
by: JC | last post by:
Hi, I have a simple question regarding the Response.Redirect method. Does the server stop processing the ASP code as soon as it encounters the Redirect command? Or does it ever continue to...
4
by: TomT | last post by:
Hi.. I'm redirecting users to another page using: response.redirect("newpage.asp") this works... But I need to add a variable to the page specified.. IE: newpage.asp?id=JobID
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
3
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
13
by: Tim | last post by:
Hello, Is there a way to "cancel" a response.Redirect? For example, in the code below, could I insert anything in the Catch statement that would cancel the redirect and resume flow after the...
10
by: Niggy | last post by:
I get an error - any help appreciated. System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.