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

Response.Redirect inside a Try Catch block

Can you put a Response.Redirect inside a Try Catch block?

I think you will get a thread Abored Error, true?
Nov 22 '05 #1
2 2599

"Craig" <No****@hotmail.com> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
Can you put a Response.Redirect inside a Try Catch block?

I think you will get a thread Abored Error, true?

Can't have one in a try catch. What you can do is test for something withing
the try catch and set it for true or false and then after try check that
value as follows

redirectvar = false
try
set redirectvar to true or false depending on conditions
catch
set redirectvar to true or false depending on conditions
end
if redirectvar = true then redirect

Mike
Nov 22 '05 #2
Thanks that is what I am doing!
"vMike" <Mi************@5nerrawgenospam.com> wrote in message
news:pl******************@newsread1.news.atl.earth link.net...

"Craig" <No****@hotmail.com> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
Can you put a Response.Redirect inside a Try Catch block?

I think you will get a thread Abored Error, true?

Can't have one in a try catch. What you can do is test for something
withing
the try catch and set it for true or false and then after try check that
value as follows

redirectvar = false
try
set redirectvar to true or false depending on conditions
catch
set redirectvar to true or false depending on conditions
end
if redirectvar = true then redirect

Mike

Nov 22 '05 #3

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

Similar topics

2
by: Craig | last post by:
Can you put a Response.Redirect inside a Try Catch block? I think you will get a thread Abored Error, true?
4
by: Cheung, Jeffrey Jing-Yen | last post by:
Has anyone noticed the use of Response.Redirect resulting in an IE 6 crash? I am aware that I could use client side javascript for a redirect, but I'd prefer not to change existing code that...
5
by: Tim | last post by:
Hello, I've noticed that sometimes putting a Response.Redirect in a Try-Catch will itself throw an exception due to a threading violation. However, in some cases it works, in others it doesn't, and...
1
by: Axel Dahmen | last post by:
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.
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: Vi | last post by:
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...
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...
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...
3
by: Marc Hoeijmans | last post by:
Hello, I have a problem with the Response.Redirect. The redirect is working for some users for other useres it is not working. We all use the same browser. I have coded the Response.Redirect after...
4
by: Alex Maghen | last post by:
Does a call to Response.Redirect result in an immediate exit from the current page function (i.e. a "return()")? I want to make sure that the statements after the Response.Redirect() do not get...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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:
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.