470,863 Members | 1,211 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

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(ByVal 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.HttpException: 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 2164
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(ByVal 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.HttpException: 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**************@TK2MSFTNGP15.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(ByVal 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.HttpException: 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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by StephenMcC | last post: by
4 posts views Thread by Harsh Thakur | last post: by
9 posts views Thread by Mark | last post: by
5 posts views Thread by Guadala Harry | last post: by
11 posts views Thread by Alexander Bosch | last post: by
8 posts views Thread by bryan | last post: by
6 posts views Thread by n# | last post: by
2 posts views Thread by =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.