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:
and this is the code behind: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>
Nothing happens when I enter some text and click the button. The code for myPage.aspx is:Code:Sub go(ByVal sender As Object, ByVal e As EventArgs) Response.Redirect("myPage.aspx") End Sub
and the code behind is:Code:<body> <form id="Form1" method="get" runat="server"> <asp:Label ID="label1" Runat="server"></asp:Label> </form> </body>
Could anyone say what goes wrong? Somehow the information gets lostCode: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


Reply With Quote