Results 1 to 2 of 2

Thread: Using request.form/querystring

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Using request.form/querystring

    I am using Visual basic.Net as language and I try to post some information between forms.
    I have a simple app with a textbox and a button:
    Code:
    <body>
    		<form id="Form1" method="post" runat="server" action=mypage.aspx>
    		<asp:TextBox ID=text1 Runat=server></asp:TextBox>
    		<asp:Button ID=submit Runat=server Text=Click OnClick=go></asp:Button>
    		</form>
    	</body>
    and this is the code behind:
    Code:
    Sub go(ByVal sender As Object, ByVal e As EventArgs)
            Response.Redirect("myPage.aspx")
        End Sub
    Nothing happens when I enter some text and click the button. The code for myPage.aspx is:
    Code:
    <body>
    		<form id="Form1" method="get" runat="server">
    			<asp:Label ID="label1" Runat="server"></asp:Label>
    		</form>
    	</body>
    and the code behind is:
    Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Put user code to initialize the page here
            Dim strName As String = Request.Form("text1")
            label1.Text = strName
        End Sub
    Could anyone say what goes wrong? Somehow the information gets lost

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width