Server.Transfer problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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/
 
msuk said:
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.>
 
Back
Top