473,387 Members | 1,504 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,387 software developers and data experts.

Response.Redirect generates and Exception

Vi
Hi,
I have a try block in which I execute a Page.Response.Redirect("myPage.aspx");

This statement always generates the exception: "Thread was being aborted"
and the execution continues in the catch block.
Is there a way to execute Page.Response.Redirect without generating this
exception?
Or if not, is there at least a way to ignore this exception in the code?

Thank you.
Nov 18 '05 #1
1 1728
You can do Page.Response.Redirect("myPage.aspx", false);

this will tell it to continue processing the page and THEN redirect....thus
not causing the thread to be aborted....personally, I don't care much for
this solution (not that it's overly bad). What's the deal with the
exception being generated? You can ignore it by swallowing it:

try{
Response.Redirect("blah.aspx");
}catch (ThreadAbortException ex){ }
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Vi" <Vi@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
Hi,
I have a try block in which I execute a Page.Response.Redirect("myPage.aspx");
This statement always generates the exception: "Thread was being aborted"
and the execution continues in the catch block.
Is there a way to execute Page.Response.Redirect without generating this
exception?
Or if not, is there at least a way to ignore this exception in the code?

Thank you.

Nov 18 '05 #2

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

Similar topics

2
by: Kerri | last post by:
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.. ...
1
by: Peter Kirk | last post by:
Hi there I have a program written by another company (it's a "web control" which returns a web-page: can I compare this to a servlet in the Java world?), which they think is causing problems on...
1
by: EagleRed | last post by:
I am writing an ASP.NET application in which I am using the Response.Redirect() call. I noticed that I catch a ThreadAbort Exception after making the call. Indeed the documentation states that this...
1
by: Henry | last post by:
Hello, I have a question about ASP.NET process. In this case: Try 'SOME CODE Response.Redirect("some_asp_page.aspx") Catch obj_Exception as Exception Throw obj_Exception
1
by: MikeM | last post by:
We are getting a behavior on a Response.Redirect("SomeUrl", True) that I'm hoping someone can explain. This all refers to the code snip at the end. By the way, this is all VB ASP.NET v1.0 code. ...
1
by: Eric | last post by:
I have the following situation: I was getting intermittent errors using Reponse.Redirct("url", true) and was trying to catch the ThreadAbortException, but it was not staying caught and was showing...
4
by: Vi | last post by:
Hi, I have an <asp:Button> control on a page. When it is clicked, I run a db stored procedure and then I want to go to the next page by executing a Response.Redirect("NextPage.aspx?id=" + myID)....
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...
3
by: jasonheath.net | last post by:
I apologize in advance for the length of this post. I wanted to get as much detail as possible in here. We have 1 web app that contains the functionality to do some single sign-on logic. The...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.