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

server.transfer error

hi i have an asp.net page and i am trying to transfer control to another
asp.net page
response.redirect works fine but server.transfer gives me the foll error
why is that

System.Threading.ThreadAbortException: Thread was being aborted. at
System.Threading.Thread.AbortInternal() at
System.Threading.Thread.Abort(Object stateInfo) at
System.Web.HttpResponse.End() at
System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) at
System.Web.HttpServerUtility.Transfer(String path) at
WebApplication1.WebForm1.cmdProceed_Click(Object sender, EventArgs e) in
e:\inetpub\wwwroot\webapplication1\addbooking.aspx .cs:line 350

private void cmdProceed_Click(object sender, System.EventArgs e)
{
try
{
saveBookingInfo();
Server.Transfer ("ProcessBooking.aspx");
//response.redirect works fine here .

}
catch(Exception ex)
{
Response.Write(ex.ToString());
}
}
Nov 17 '05 #1
8 3460
This is what's supposed to happen. The main thread is getting aborted so the
new thread can start for the target page. In your catch block determine
whether you cought the ThreadAbortException and if yes throw it again.
Everything should work after that.
Nov 17 '05 #2
This is what's supposed to happen. The main thread is getting aborted so the
new thread can start for the target page. In your catch block determine
whether you cought the ThreadAbortException and if yes throw it again.
Everything should work after that.
Nov 17 '05 #3
hi i simply removed the try - catch and it worked.
but im not sure if this is the right way to do this.

thanx

now my problem is
1. i was trying to pass a dataset between pages. (using code-behind files)
and it works.. but i read on msdn that i need to create a dll (maybe it is
used while deploying)
and i get the foll error

csc /out:Bin\CarRentalWebApp.dll /r:System.dll /r:System.Web.dll /t:library
AddBooking.aspx.cs ProcessBooking.aspx.cs
when i do this it gives me the foll error
AddBooking.aspx.cs(12,23): error CS0234: The type or namespace name
'localhost'
does not exist in the class or namespace 'WebApplication1' (are you
missing an assembly reference?)

localhost is referencing my local webservice.

what should i do?

2. also i read in
http://msdn.microsoft.com/library/de...tweenpages.asp

that i can use inline code to transfer my dataset but i dont know how to use
the dataset namespace in my aspx file
<%@ Page language="c#" Codebehind="ProcessBooking.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.ProcessBooking" %>
<%@ Reference Page="AddBooking.aspx"
using System.Data.SqlClient%>

i tried using System.Data.SqlClient, but that gives me errors.

thanx
Nov 17 '05 #4
hi i simply removed the try - catch and it worked.
but im not sure if this is the right way to do this.

thanx

now my problem is
1. i was trying to pass a dataset between pages. (using code-behind files)
and it works.. but i read on msdn that i need to create a dll (maybe it is
used while deploying)
and i get the foll error

csc /out:Bin\CarRentalWebApp.dll /r:System.dll /r:System.Web.dll /t:library
AddBooking.aspx.cs ProcessBooking.aspx.cs
when i do this it gives me the foll error
AddBooking.aspx.cs(12,23): error CS0234: The type or namespace name
'localhost'
does not exist in the class or namespace 'WebApplication1' (are you
missing an assembly reference?)

localhost is referencing my local webservice.

what should i do?

2. also i read in
http://msdn.microsoft.com/library/de...tweenpages.asp

that i can use inline code to transfer my dataset but i dont know how to use
the dataset namespace in my aspx file
<%@ Page language="c#" Codebehind="ProcessBooking.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.ProcessBooking" %>
<%@ Reference Page="AddBooking.aspx"
using System.Data.SqlClient%>

i tried using System.Data.SqlClient, but that gives me errors.

thanx
Nov 17 '05 #5
....Try

Sever.Transfer("pagename", false)
Nov 17 '05 #6
....Try

Sever.Transfer("pagename", false)
Nov 17 '05 #7
I can answer why Server.Transfer (and Response.End) will not work inside a
checked block - it's because those two methods throw an exception to end the
current page execution. If you catch it the Asp.Net framework will never
know about it...

As for the error - I think you wanted to use localhost in a string, as in an
Url, not as a variable/namespace name. Of course it would be much easier if
I didn't have to guess what's on that line that triggers the error...

Jerry

"shin" <as**@hotmail.com> wrote in message
news:OE**************@TK2MSFTNGP09.phx.gbl...
hi i simply removed the try - catch and it worked.
but im not sure if this is the right way to do this.

thanx

now my problem is
1. i was trying to pass a dataset between pages. (using code-behind files)
and it works.. but i read on msdn that i need to create a dll (maybe it is
used while deploying)
and i get the foll error

csc /out:Bin\CarRentalWebApp.dll /r:System.dll /r:System.Web.dll /t:library AddBooking.aspx.cs ProcessBooking.aspx.cs
when i do this it gives me the foll error
AddBooking.aspx.cs(12,23): error CS0234: The type or namespace name
'localhost'
does not exist in the class or namespace 'WebApplication1' (are you missing an assembly reference?)

localhost is referencing my local webservice.

what should i do?

2. also i read in
http://msdn.microsoft.com/library/de...tweenpages.asp
that i can use inline code to transfer my dataset but i dont know how to use the dataset namespace in my aspx file
<%@ Page language="c#" Codebehind="ProcessBooking.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.ProcessBooking" %>
<%@ Reference Page="AddBooking.aspx"
using System.Data.SqlClient%>

i tried using System.Data.SqlClient, but that gives me errors.

thanx

Nov 17 '05 #8
I can answer why Server.Transfer (and Response.End) will not work inside a
checked block - it's because those two methods throw an exception to end the
current page execution. If you catch it the Asp.Net framework will never
know about it...

As for the error - I think you wanted to use localhost in a string, as in an
Url, not as a variable/namespace name. Of course it would be much easier if
I didn't have to guess what's on that line that triggers the error...

Jerry

"shin" <as**@hotmail.com> wrote in message
news:OE**************@TK2MSFTNGP09.phx.gbl...
hi i simply removed the try - catch and it worked.
but im not sure if this is the right way to do this.

thanx

now my problem is
1. i was trying to pass a dataset between pages. (using code-behind files)
and it works.. but i read on msdn that i need to create a dll (maybe it is
used while deploying)
and i get the foll error

csc /out:Bin\CarRentalWebApp.dll /r:System.dll /r:System.Web.dll /t:library AddBooking.aspx.cs ProcessBooking.aspx.cs
when i do this it gives me the foll error
AddBooking.aspx.cs(12,23): error CS0234: The type or namespace name
'localhost'
does not exist in the class or namespace 'WebApplication1' (are you missing an assembly reference?)

localhost is referencing my local webservice.

what should i do?

2. also i read in
http://msdn.microsoft.com/library/de...tweenpages.asp
that i can use inline code to transfer my dataset but i dont know how to use the dataset namespace in my aspx file
<%@ Page language="c#" Codebehind="ProcessBooking.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.ProcessBooking" %>
<%@ Reference Page="AddBooking.aspx"
using System.Data.SqlClient%>

i tried using System.Data.SqlClient, but that gives me errors.

thanx

Nov 17 '05 #9

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

Similar topics

1
by: Jim | last post by:
Any idea what is causing this error? 006~ASP 0230~Server.Transfer Error~The call to Server.Transfer failed while loading the page. Just read about benefits of Server.Transfer over...
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"...
6
by: Tlink | last post by:
I am using server.transfer from within vb.net, which is called from asp.net I find that I can move to correct page the first time the server.transfer is executed but all subsequent attempts cause a...
3
by: yma | last post by:
Hi, I put a .aspx page inside Server.Transfer() within a button. The page was created for testing so it only has button and I did not add code. When I click the button, it gave me an error...
9
by: Steve Buster | last post by:
All right, I have read every forum, newsgroup etc about this issue and no one seems to know how to fix it. I am getting a "Server Application Unavailable" exception running my .NET 1.1...
1
by: Craig Banks | last post by:
I have 2 ASP.Net solutions/projects. I want to use Server.Transfer in one solution/project to call the aspx webform in the second solution/project. When I try it I get an error message. My call is...
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...
6
by: n# | last post by:
A Basic Question in ASP.NEt 1.1 In Page_Load Event I am doing a Server.Transfer. But it throws an error on the browser windows showing "Server Application Not Found" Pls help me
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
2
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi, I'm using Threads, and when I try to do Server.Transfer, I recieved an error. (child object does not exist...) My Code: Dim t As New Thread(AddressOf Hilo) Private Sub Hilo()...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.