Problem with server.transfer

When using server.transfer generates the following error.
Thread was being aborted
Mscorlib

I have added

Catch threadEx As System.Threading.ThreadAbortException

' do nothing

To the code but still the error is produced, the page is not transferred to
the other page but the same page. It then rolls back the database changes.

What is required to get the server.transfer to work in a try catch
statement?
robin [ Fr, 04 März 2005 22:03 ] [ ID #677045 ]

Re: Problem with server.transfer

"Robin" <robin9876 [at] hotmail.com> wrote in message
news:OlE$21PIFHA.3588 [at] TK2MSFTNGP14.phx.gbl...

> When using server.transfer generates the following error.
> Thread was being aborted

Use Response.Redirect (<URL>, false) instead
Mark Rae [ Fr, 04 März 2005 22:33 ] [ ID #677055 ]

Re: Problem with server.transfer

Server.Transfer(), Response.End(), and Response.Redirect work by killing the
current thread. don't catch the thread abort. they all have an option to not
do the abort - but then the rest of the page processing continues (instead
of terminating at the statement), which may cause you problems.


-- bruce (sqlwork.com)




"Robin" <robin9876 [at] hotmail.com> wrote in message
news:OlE$21PIFHA.3588 [at] TK2MSFTNGP14.phx.gbl...
| When using server.transfer generates the following error.
| Thread was being aborted
| Mscorlib
|
| I have added
|
| Catch threadEx As System.Threading.ThreadAbortException
|
| ' do nothing
|
| To the code but still the error is produced, the page is not transferred
to
| the other page but the same page. It then rolls back the database changes.
|
| What is required to get the server.transfer to work in a try catch
| statement?
|
|
bruce barker [ Sa, 05 März 2005 02:03 ] [ ID #678131 ]

Re: Problem with server.transfer

How do you not catch the thread abort but catch other errors?

"bruce barker" <nospam_brubar [at] safeco.com> wrote in message
news:%23lo3q8RIFHA.2276 [at] TK2MSFTNGP15.phx.gbl...
> Server.Transfer(), Response.End(), and Response.Redirect work by killing
the
> current thread. don't catch the thread abort. they all have an option to
not
> do the abort - but then the rest of the page processing continues (instead
> of terminating at the statement), which may cause you problems.
>
>
> -- bruce (sqlwork.com)
>
>
>
>
> "Robin" <robin9876 [at] hotmail.com> wrote in message
> news:OlE$21PIFHA.3588 [at] TK2MSFTNGP14.phx.gbl...
> | When using server.transfer generates the following error.
> | Thread was being aborted
> | Mscorlib
> |
> | I have added
> |
> | Catch threadEx As System.Threading.ThreadAbortException
> |
> | ' do nothing
> |
> | To the code but still the error is produced, the page is not transferred
> to
> | the other page but the same page. It then rolls back the database
changes.
> |
> | What is required to get the server.transfer to work in a try catch
> | statement?
> |
> |
>
>
robin [ So, 06 März 2005 22:58 ] [ ID #679702 ]

Re: Problem with server.transfer

like bruce said use the response.redirect(page.aspx,false)

--
Regards,
Alvin Bruney

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
------------------------------------------------------------

"Robin" <robin9876 [at] hotmail.com> wrote in message
news:eu1CXepIFHA.3588 [at] TK2MSFTNGP14.phx.gbl...
> How do you not catch the thread abort but catch other errors?
>
> "bruce barker" <nospam_brubar [at] safeco.com> wrote in message
> news:%23lo3q8RIFHA.2276 [at] TK2MSFTNGP15.phx.gbl...
>> Server.Transfer(), Response.End(), and Response.Redirect work by killing
> the
>> current thread. don't catch the thread abort. they all have an option to
> not
>> do the abort - but then the rest of the page processing continues
>> (instead
>> of terminating at the statement), which may cause you problems.
>>
>>
>> -- bruce (sqlwork.com)
>>
>>
>>
>>
>> "Robin" <robin9876 [at] hotmail.com> wrote in message
>> news:OlE$21PIFHA.3588 [at] TK2MSFTNGP14.phx.gbl...
>> | When using server.transfer generates the following error.
>> | Thread was being aborted
>> | Mscorlib
>> |
>> | I have added
>> |
>> | Catch threadEx As System.Threading.ThreadAbortException
>> |
>> | ' do nothing
>> |
>> | To the code but still the error is produced, the page is not
>> transferred
>> to
>> | the other page but the same page. It then rolls back the database
> changes.
>> |
>> | What is required to get the server.transfer to work in a try catch
>> | statement?
>> |
>> |
>>
>>
>
>
Alvin Bruney [ Mo, 07 März 2005 00:12 ] [ ID #680348 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » Problem with server.transfer

Vorheriges Thema: Calculating a Subtotal for Shopping Cart
Nächstes Thema: Running scripts at server or side client