473,473 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Server.Transfer problem

All,

I have a ASP.NET webform that has a button that when clicked simply directs
the user to another .htm page - code below

private void btnSend_Click(object sender, System.EventArgs e)
{

try
{
Server.Transfer("thanksr.htm");
}
catch(Exception ex)
{
string message=ex.Message;
}

}

When I attempt to perform the Server.Transfer I get an error saying "Error
executing child request for thanks.htm."

What am I doing wrong?

Thanks
Msuk
Nov 16 '05 #1
5 1438
> I have a ASP.NET webform that has a button that when clicked simply
directs
the user to another .htm page - code below

Server.Transfer can only be used to transfer execution to another ASPX page.
You will have to user Response.Redirect to redirect the user to your HTML
page.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 16 '05 #2
Hi

I have converted my .htm to a .aspx webform and when I perform the
Server.Transfer("thanks.aspx") the catch block is invoked with an error
saying 'Thread is aborting' but the the new page appears - what is still
wrong?

Thanks
Msuk

"Anders Norås [MCAD]" wrote:
I have a ASP.NET webform that has a button that when clicked simply
directs
the user to another .htm page - code below

Server.Transfer can only be used to transfer execution to another ASPX page.
You will have to user Response.Redirect to redirect the user to your HTML
page.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/

Nov 16 '05 #3
> I have converted my .htm to a .aspx webform and when I perform the
Server.Transfer("thanks.aspx") the catch block is invoked with an error
saying 'Thread is aborting' but the the new page appears - what is still
wrong?

The Server.Transfer method ends the current response by calling
Response.End. The Resonse.End method calls the Abort method on the current
thread. This is why you get a "thread is aborting" exception. There is
nothing wrong with you code.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 16 '05 #4


"msuk" <ms**@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
All,

I have a ASP.NET webform that has a button that when clicked simply
directs

Please post ASP.NET questions to the asp.net NG.-
microsoft.public.dotnet.framework.aspnet . This NG is for Csharp

Willy.>
Nov 16 '05 #5
hi,

I managed to find the solutuion -
http://support.microsoft.com/default...b;en-us;312629

Thanks
Msuk

"Anders Norås [MCAD]" wrote:
I have converted my .htm to a .aspx webform and when I perform the
Server.Transfer("thanks.aspx") the catch block is invoked with an error
saying 'Thread is aborting' but the the new page appears - what is still
wrong?

The Server.Transfer method ends the current response by calling
Response.End. The Resonse.End method calls the Abort method on the current
thread. This is why you get a "thread is aborting" exception. There is
nothing wrong with you code.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/

Nov 16 '05 #6

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

Similar topics

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...
8
by: Cathie | last post by:
Hi guys, I want to do a Server.Transfer to get to a second page, so that I may retrieve variables I have set in the first page. I'm doing that with the usual Server.Transfer("pagename", true). ...
9
by: Mark | last post by:
Hello I'm trying to use a Server.Transfer in a try-catch (I cannot put it outside the Try-Catch as it is nested deep within a component that is called in a try-catch loop) The problem is that the...
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...
5
by: Guadala Harry | last post by:
I've been reading up on Server.Transfer as well as doing some testing, and it appears to always raise the ThreadAbortException error. On one hand I've read a bunch of promotional-type material...
11
by: Alexander Bosch | last post by:
Hi, I'm having a problem similar to the one that's stated in this KB http://support.microsoft.com/default.aspx?scid=kb;en-us;839521 When I'm posting a page to itself with the bool value as true it...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
1
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...
0
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...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
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.