473,795 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with server.transfer

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

I have added

Catch threadEx As System.Threadin g.ThreadAbortEx ception

' 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 2893
"Robin" <ro*******@hotm ail.com> wrote in message
news:Ol******** ******@TK2MSFTN GP14.phx.gbl...
When using server.transfer generates the following error.
Thread was being aborted


Use Response.Redire ct (<URL>, false) instead
Nov 19 '05 #2
Server.Transfer (), Response.End(), and Response.Redire ct 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*******@hotm ail.com> wrote in message
news:Ol******** ******@TK2MSFTN GP14.phx.gbl...
| When using server.transfer generates the following error.
| Thread was being aborted
| Mscorlib
|
| I have added
|
| Catch threadEx As System.Threadin g.ThreadAbortEx ception
|
| ' 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******** ********@TK2MSF TNGP15.phx.gbl. ..
Server.Transfer (), Response.End(), and Response.Redire ct 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*******@hotm ail.com> wrote in message
news:Ol******** ******@TK2MSFTN GP14.phx.gbl...
| When using server.transfer generates the following error.
| Thread was being aborted
| Mscorlib
|
| I have added
|
| Catch threadEx As System.Threadin g.ThreadAbortEx ception
|
| ' 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.redire ct(page.aspx,fa lse)

--
Regards,
Alvin Bruney

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

"Robin" <ro*******@hotm ail.com> wrote in message
news:eu******** ******@TK2MSFTN GP14.phx.gbl...
How do you not catch the thread abort but catch other errors?

"bruce barker" <no***********@ safeco.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Server.Transfer (), Response.End(), and Response.Redire ct 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*******@hotm ail.com> wrote in message
news:Ol******** ******@TK2MSFTN GP14.phx.gbl...
| When using server.transfer generates the following error.
| Thread was being aborted
| Mscorlib
|
| I have added
|
| Catch threadEx As System.Threadin g.ThreadAbortEx ception
|
| ' 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.Redire ct() 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
2074
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" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp Everything works well except for context.server.transfer(string url) method (refer to RedirectingCommand.cs class in the above documentation) Here are the error details Server...
11
6639
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 transfer data across.On the serve I am using Socket 2 API (recv function to read bytes)and not using ..NET. I use FileStream to open the file on the pocket pc, then associate a BinaryReader object with the stream and call ReadBytes to read all the...
6
3259
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 query-string flag is used to indicate to the page whether it should instantiate a new instance of the object or access an existing instance from the calling page. On the both pages I have a property of the page which is an instance of this custom...
8
1870
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 PC's and Macintosh computers. I've re-written this application in ASP.NET for a number of reasons and now find that my Mac users are having problems with the application. SSL works just fine for PC
5
3758
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 manner when i move it to Prod environment. Please have a look at the following code snippet... //Page name - Add.aspx private void Page_Load(object sender, System.EventArgs e)
1
1181
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. So if I start from form 1 and press Next, 4 times it will come to form 4. Now when when I go back to form 1(If needed) all those forms should save its previous state. I have tried this using VIEWSTATE. But it acts werid.(That is cause am doing...
4
1777
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 Server.Transfer, the user gets a page has expired error. Is there a way to keep using Server.Transfer, but also have the back button work normally?
2
1846
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 to aspx C. But I face a problem that when I click the button in aspx B, exception appear which said the view state is invalid. But if I have not used Server.Transfer from aspx A to aspx B , the Server.Transfer from aspx B to aspx C works...
12
1961
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 still in default page. I thought Action will direct page to page2.aspx, no??? <form id="Form1" method="post" runat="server" action="page2.aspx"> <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
5
2185
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 usercontrols (e.g. header and footer) on pages. The module determines if templates should be added to the page using Page.Request.Path. It matches the current adress to settings found in a configuration-file... It works like a charm except for one...
0
10438
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7540
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.