twilitegxa Posted September 30, 2009 Share Posted September 30, 2009 I need help with the following form: page one: form page two: summary of form values, confirm button (takes to default.aspx), cancel button (takes back to form with values still filled in) I have these pages currently: page one: <!-- UserForm.aspx --> <%@ Page Language="VB" ClassName="SenderClass" %> <script runat="server"> ' Readonly property for name Public ReadOnly Property Name() As String Get Return USerName.Text End Get End Property 'Readonly Property for phone Public ReadOnly Property Phone() As String Get Return UserPhone.Text End Get End Property 'Event to transfer page control to Result.aspx Sub Page_Transfer(sender As Object, e As EventArgs) Server.Transfer("Result.aspx") End sub </script> <html> <head> </head> <body> <form id="Form1" runat="server"> User Name: <asp:TextBox ID="UserName" runat="server" /> Phone: <asp:TextBox ID="UserPhone" runat="server" /><br> <asp:Button ID="Button1" Text="Submit" OnClick="Page_Transfer" runat="server" /> </form> </body> </html> page two: <!-- Result.aspx --> <%@ Page Language="VB" %> <%@ Reference Page="UserForm.aspx" %> <script runat="server"> Dim result As SenderClass Sub Page_load(obj as Object, e as EventArgs) Dim content As String If Not IsPostBack Then result = CType(Context.Handler, SenderClass) content = "Name: " + result.Name + "<br>" _ + "Phone: " + result.Phone Label1.text = content End If End Sub </script> <html> <head> </head> <body> <h1>Summary:</h1> <i><form id="Form1" runat="server"> <asp:Label id="Label1" runat="server" /></i><br /><br /> <asp:Button ID="Confirm" runat="server" Text="Confirm" PostBackUrl="default.aspx" /> <asp:Button ID="Cancel" runat="server" Text="Cancel" /></form> </body> </html> Page two displays the summary, and has the confirm and cancel button. I have confirm set to go to the default.aspx page, but how do I get the cancel button to take the user back to the form (userform.aspx) with the form fields filled in with the previous data the user had filed in? Quote Link to comment https://forums.phpfreaks.com/topic/176019-postback-to-form-with-values-filled-in/ Share on other sites More sharing options...
trq Posted September 30, 2009 Share Posted September 30, 2009 This is a PHP forum. Quote Link to comment https://forums.phpfreaks.com/topic/176019-postback-to-form-with-values-filled-in/#findComment-927516 Share on other sites More sharing options...
jellis Posted October 6, 2009 Share Posted October 6, 2009 I LOL'd... how funny is that?!?! Quote Link to comment https://forums.phpfreaks.com/topic/176019-postback-to-form-with-values-filled-in/#findComment-931248 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.