M
Michael
I am have trouble sending data across multiple forms but the data is either
not going through or is being lost. Can anyone help me with this problem?
Thanks in advance.
I am using Visual Web Developer 2008 Express Edition.
I have a form that was created using the 'Standard' group in the toolbox.
The controls used from the 'Standard' group are 1 TextBox and 1 Button. They
are located on the index.aspx page.
The textbox is named: txtFirstName
The button is named: Button1
I am trying to send the data from the txtFirstName textbox that is on the
index.aspx page to the 1.aspx page, and then in turn send that same data to
the 2.aspx page.
The postbackURL for Button1 is 1.aspx. The text from the txtFirstName
textbox reaches 1.aspx fine and I am able to display it on the screen.
The data is then stored in a HiddenField named hiddenFirstName on a form in
1.aspx and then sent to 2.aspx when when Button1 on the form on the 1.aspx
page is clicked.
However, the data from the hiddenFirstName HiddenField never appears or
received.
The code for the three pages is below. (They are short and simple)
Here is the code for index.asp
-----------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<br />
<br />
First Name:
<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" PostBackUrl="1.aspx" Text="Button"
/>
</form>
</body>
</html>
-----------------------------------------
Here is the code for 1.asp
-----------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<br />
<%
Dim firstname As String
firstname = Request.Form("txtFirstName")
Response.Write("First Name is " & firstname & " /// ")
%>
<br />
<asp:HiddenField ID="hiddenFirstName" runat="server" value="<%firstname%>"
/>
<br />
<asp:Button ID="Button1" runat="server" PostBackUrl="2.aspx" Text="Button"
/>
</form>
</body>
</html>
-----------------------------------------
Here is the code for 2.asp
-----------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<%
Dim firstname As String
firstname = Request.Form("hiddenFirstName")
Response.Write(Request.Form("hiddenTripType"))
%>
</form>
</body>
</html>
-----------------------------------------
not going through or is being lost. Can anyone help me with this problem?
Thanks in advance.
I am using Visual Web Developer 2008 Express Edition.
I have a form that was created using the 'Standard' group in the toolbox.
The controls used from the 'Standard' group are 1 TextBox and 1 Button. They
are located on the index.aspx page.
The textbox is named: txtFirstName
The button is named: Button1
I am trying to send the data from the txtFirstName textbox that is on the
index.aspx page to the 1.aspx page, and then in turn send that same data to
the 2.aspx page.
The postbackURL for Button1 is 1.aspx. The text from the txtFirstName
textbox reaches 1.aspx fine and I am able to display it on the screen.
The data is then stored in a HiddenField named hiddenFirstName on a form in
1.aspx and then sent to 2.aspx when when Button1 on the form on the 1.aspx
page is clicked.
However, the data from the hiddenFirstName HiddenField never appears or
received.
The code for the three pages is below. (They are short and simple)
Here is the code for index.asp
-----------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<br />
<br />
First Name:
<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" PostBackUrl="1.aspx" Text="Button"
/>
</form>
</body>
</html>
-----------------------------------------
Here is the code for 1.asp
-----------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<br />
<%
Dim firstname As String
firstname = Request.Form("txtFirstName")
Response.Write("First Name is " & firstname & " /// ")
%>
<br />
<asp:HiddenField ID="hiddenFirstName" runat="server" value="<%firstname%>"
/>
<br />
<asp:Button ID="Button1" runat="server" PostBackUrl="2.aspx" Text="Button"
/>
</form>
</body>
</html>
-----------------------------------------
Here is the code for 2.asp
-----------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<%
Dim firstname As String
firstname = Request.Form("hiddenFirstName")
Response.Write(Request.Form("hiddenTripType"))
%>
</form>
</body>
</html>
-----------------------------------------