473,327 Members | 2,081 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,327 software developers and data experts.

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?
Nov 19 '05 #1
5 2875
"Robin" <ro*******@hotmail.com> wrote in message
news:Ol**************@TK2MSFTNGP14.phx.gbl...
When using server.transfer generates the following error.
Thread was being aborted


Use Response.Redirect (<URL>, false) instead
Nov 19 '05 #2
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" <ro*******@hotmail.com> wrote in message
news:Ol**************@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?
|
|
Nov 19 '05 #3
How do you not catch the thread abort but catch other errors?

"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@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" <ro*******@hotmail.com> wrote in message
news:Ol**************@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?
|
|

Nov 19 '05 #4
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" <ro*******@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP14.phx.gbl...
How do you not catch the thread abort but catch other errors?

"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@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" <ro*******@hotmail.com> wrote in message
news:Ol**************@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?
|
|


Nov 19 '05 #5
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!

Nov 19 '05 #6

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

Similar topics

0
by: Srini | last post by:
I am implementing Front Controller in ASP.net as outlined in Microsoft documentation titled "Implementing Front Controller in ASP.NET Using HTTPHandler"...
11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
8
by: Bob Skutnick | last post by:
Greetings, I'm hoping someone has experienced a problem I'm having: I have an existing ASP application (working fine) that uses an SSL server certificate. My user community is made up of both...
5
by: Nedu N | last post by:
Hi All, I am facing a typical problem in my .NET application with the pop-up script messages. The thing is that its working fine when i run on my development machine but not running in expected...
1
by: KK | last post by:
Hi I am trying to implement a couple of webforms which will work as a normal installation program. That is from each form you can go to the NEXT or PREVIOUS form. I want to have about 4 forms....
4
by: john | last post by:
I have an app that uses Server.Transfer from page1 to page2. page2 needs to be able to read all the values from page1's form. The problem is, if the user clicks the back button on page2 after a...
2
by: Tony Cheng | last post by:
When I use Server.Transfer from aspx A to aspx B, it's ok but when I click a button in aspx B, the expected behaviour is that Server.Transfer would be called again and the page would go from aspx B...
12
by: Britney | last post by:
Hi guys, in my default.aspx file, I have following code. when I go to browser, I enter values in both textboxs, then I hit submit Button, however, it didn't go to page2.aspx. instead, it was...
5
by: Richard | last post by:
I've developed a small ASPX template framework (based on Chun Li's article on CodeProject: http://www.codeproject.com/aspnet/headerfooter.asp#xx849313xx) which uses a IHttpModule to apply...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.