Hi there,
I have a very simple three page web application that I am
having trouble with. If there are any problems with any of the parameters
that are passed to the first page, I want to redirect to an error page and
display a message. However, when I call Response.Redirect, I get an
exception "Thread was being aborted". I have set the EndResponse parameter
set to true. The first page does not actually have any output, could that
be something to do with it?
Thanks. 6 1240
There's nothing wrong. When the response redirects, it aborts the processing
of the first page and sends the 302 redirect to the browser. That's normal
and prevents the first page from going on it's merry way.
--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
"Waldy" <so*****@microsoft.comwrote in message
news:e6**************@TK2MSFTNGP06.phx.gbl...
Hi there,
I have a very simple three page web application that I am
having trouble with. If there are any problems with any of the parameters
that are passed to the first page, I want to redirect to an error page and
display a message. However, when I call Response.Redirect, I get an
exception "Thread was being aborted". I have set the EndResponse
parameter set to true. The first page does not actually have any output,
could that be something to do with it?
Thanks.
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
There's nothing wrong. When the response redirects, it aborts the
processing of the first page and sends the 302 redirect to the browser.
That's normal and prevents the first page from going on it's merry way.
Hi Mark,
so I cannot call Response.Redirect in a try catch block?
Regards,
Waldy.
This situation can cause issues when you have a redirect inside a try block
though. At least I think that's the issue.
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
There's nothing wrong. When the response redirects, it aborts the
processing of the first page and sends the 302 redirect to the browser.
That's normal and prevents the first page from going on it's merry way.
--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
"Waldy" <so*****@microsoft.comwrote in message
news:e6**************@TK2MSFTNGP06.phx.gbl...
>Hi there, I have a very simple three page web application that I am having trouble with. If there are any problems with any of the parameters that are passed to the first page, I want to redirect to an error page and display a message. However, when I call Response.Redirect, I get an exception "Thread was being aborted". I have set the EndResponse parameter set to true. The first page does not actually have any output, could that be something to do with it?
Thanks.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:OY**************@TK2MSFTNGP02.phx.gbl...
"Waldy" <so*****@microsoft.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
You can, but the "usual" way is to use the boolean overload: http://msdn2.microsoft.com/en-us/lib...dt(vs.80).aspx
I am using the parameter, but set to true. What is the default if it is not
specfied?
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:OY**************@TK2MSFTNGP02.phx.gbl...
"Waldy" <so*****@microsoft.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>so I cannot call Response.Redirect in a try catch block?
You can, but the "usual" way is to use the boolean overload: http://msdn2.microsoft.com/en-us/lib...dt(vs.80).aspx
Setting the parameter to false, stops the exception.
Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
by: FN |
last post by:
I'm using User.Identity.IsAuthenticated on all my pages (from a base class),
and redirecting to a login page if not authenticated. The problem is that
some pages are in subfolders and others are...
|
by: Anthony Williams |
last post by:
Hi gang,
This one looks like a bug :o(
As you may or may not know, setting session management in web.config to use
cookieless sessions causes the ASP.NET runtime to munge a session ID into...
|
by: Sam Miller |
last post by:
I have a submit button. In the event handler for that button I connect to
database and write all the control values to the db. Then I have a
response.redirect after the Conn.Close to leave the...
|
by: csn |
last post by:
Is it possible to have a Response.Redirect in Global.asax in the
Application_Start and Session_Start events?
We have code in both events, with try-catch blocks, and if an exception is
caught, we...
| |
by: postings |
last post by:
Just a quick question...
When I do a "response.redirect" from a source webpage to a destination
webpage, does the code on the source webpage carry on executing unless
I put a "response.end"...
|
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...
|
by: =?Utf-8?B?d2ViZ3V5QGNvbW11bml0eS5ub3NwYW0=?= |
last post by:
We have been running into some problems where using Response.Redirect causes
the page to hang and it never actually redirects.
Here's the scenario:
User opens the page, selects an item from the...
|
by: kmithu |
last post by:
I am working on Asp.Net2.0 on which i have used ajax. I am well aware that Response.Write() is not supported by AJAX but what about Response.Redirect()?
The error which i am getting is written...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |