473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server.transfer

Dan
VB.NET....

Serving page 1 which has a text box and a button. When the button is push
the button_click event is called. In this event I want to serve Page 2 if
the text box contains <value1> and page 3 if the text box contains <value2>.

I am having trouble with the code to effect the transfer. The IF clause
works correctly.
---------------
Private Sub Button1_Click(B yVal sender as System.Object, ByVal e As
SystemEventArgs ) Handles Burron1.click

If Text1.text = "text1" then
Server.Transfer ("page2")
else
Server.Transfer ("page3")
End IF

End Sub
------------

Page 1 displays correctly. After clicking the button, I get
"Server Error in '/test' Application
Exception Details: System.Web.Http Exception: Error executing child request
for page2

Both pages are in the same project and were built in VB.NET with .aspx
extensions.

Thanks for your help.
Jul 21 '05 #1
2 2352
Hi Dan,

Serving page 1 which has a text box and a button. When the button is push
the button_click event is called. In this event I want to serve Page 2 if
the text box contains <value1> and page 3 if the text box contains <value2>.

I am having trouble with the code to effect the transfer. The IF clause
works correctly.
---------------
Private Sub Button1_Click(B yVal sender as System.Object, ByVal e As
SystemEventArgs ) Handles Burron1.click

If Text1.text = "text1" then
Server.Transfer ("page2")
else
Server.Transfer ("page3")
End IF
BTW, it Should be Text1.Text ="Value". Since you mentioned that IF condition
works properly, i think the problem lies in the way the Page 3 is handling
the QueryString.
The error points to the page2. Are you redirecting it to the right page???.

Hope this helps....
Happy Coding

End Sub
------------

Page 1 displays correctly. After clicking the button, I get
"Server Error in '/test' Application
Exception Details: System.Web.Http Exception: Error executing child request
for page2

Both pages are in the same project and were built in VB.NET with .aspx
extensions.

Thanks for your help.

Jul 21 '05 #2
J
What are the full path names to the files. Just "page2", not "page2.htm" or
"page2.aspx " ? And make sure to use the other version of the call to
preserve posted data.
"Dan" <da*@dsully.com > wrote in message
news:OZ******** ******@TK2MSFTN GP15.phx.gbl...
VB.NET....

Serving page 1 which has a text box and a button. When the button is push
the button_click event is called. In this event I want to serve Page 2 if
the text box contains <value1> and page 3 if the text box contains
<value2>.

I am having trouble with the code to effect the transfer. The IF clause
works correctly.
---------------
Private Sub Button1_Click(B yVal sender as System.Object, ByVal e As
SystemEventArgs ) Handles Burron1.click

If Text1.text = "text1" then
Server.Transfer ("page2")
else
Server.Transfer ("page3")
End IF

End Sub
------------

Page 1 displays correctly. After clicking the button, I get
"Server Error in '/test' Application
Exception Details: System.Web.Http Exception: Error executing child request
for page2

Both pages are in the same project and were built in VB.NET with .aspx
extensions.

Thanks for your help.

Jul 21 '05 #3

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

Similar topics

6
2230
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web site on its own, so I will end up having two web sites. This planned to aid problems we've been having with performance, as if the portion (which is an...
4
2092
by: Harsh Thakur | last post by:
Hi, I'd like to know the performance related differences between Response.Redirect and Server.Transfer. I'd like to redirect the user to a different page. I can either do a Response.Redirect("URL") or a Server.Transfer("URL"). So I'd like to find out which is more efficient/better. Can anyone please tell me or give any pointers to links on...
5
7810
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user to the Item page "ViewItem.aspx" with a simple : Server.Transfer("ViewItem.aspx"); I'd like to pass another HTTP parameter so that in the...
9
4594
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 Server.Transfer always throws the ThreadAbortException. MSDN acknowledges that this is a unque exception that will be automatically rethrown - i.e....
5
2562
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 touting the benefits of Server.Transfer and none of them mention ThreadAbortException - but the MSDN documentation says Server.Transfer will always...
11
6006
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 falls into an infinite loop and later a StackOverflow Exception. I need to do this and not a Response.Redirect or a transfer with the bool in...
8
3878
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 need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the...
6
2175
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
3991
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. In my masterpage I have this: private bool m_AlreadyTested; public bool AlreadyTested { get { return m_AlreadyTested; }
2
3091
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() Thread.Sleep(1000)
0
7401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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. ...
1
7423
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...
0
7757
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...
0
4945
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...
0
3450
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...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
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 we have to send another system
1
1014
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.