Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with server.transfer

Reply
Thread Tools

Problem with server.transfer

 
 
Robin
Guest
Posts: n/a
 
      03-04-2005
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?


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      03-04-2005
"Robin" <(E-Mail Removed)> wrote in message
news:OlE$(E-Mail Removed)...

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


Use Response.Redirect (<URL>, false) instead


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      03-05-2005
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" <(E-Mail Removed)> wrote in message
news:OlE$(E-Mail Removed)...
| 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?
|
|


 
Reply With Quote
 
Robin
Guest
Posts: n/a
 
      03-06-2005
How do you not catch the thread abort but catch other errors?

"bruce barker" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:OlE$(E-Mail Removed)...
> | 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?
> |
> |
>
>



 
Reply With Quote
 
Alvin Bruney [ASP.NET MVP]
Guest
Posts: n/a
 
      03-06-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do you not catch the thread abort but catch other errors?
>
> "bruce barker" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:OlE$(E-Mail Removed)...
>> | 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?
>> |
>> |
>>
>>

>
>



 
Reply With Quote
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      03-07-2005
Hi Robin ....Some differences i came to find out with time.
Hope it helps
Patrick

The Response.Redirect() method can be used to connect to any specified
URL. The specified URL can point to any resource and may also contain
query strings. The use of Response. Redirect causes an additional round
trip to the server.

The Server.Transfer( ) method performs a server-side redirection of a
page. The use of Server.Transfer( ) avoids an extra round trip but only
works with an ASPX file residing in the
same Web application on the same Web server. Also, when you use the
Server.Transfer method, any query string on the original request is not
automatically passed to the new page.

The Server.Execute method is like a function call to an ASPX file. This
method executes the specified ASPX file and then returns execution to
the calling ASPX page. The file specified
as an argument to the Server.Execute( ) must be an ASPX file residing on
the same Web server and the argument should not contain query string
data.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments