On the first page, users enter things into textboxes, then they click button_1 which does something like the paraphrased code below:
This captures the values entered by the user in a session variable so the app will remember the input values:
The intent is to handle if the user submits to page2 and then suddenly realizes "oops, i messed up something on page1, let me go back"
On page2, there is a "GoBack" button whose btnGoBack_Click event is:
and on page_load of page1, I have
which serves to re-populate the textboxes with the originally entered values.
PROBLEM: When the user makes a change to, say Address1.Text, and then clicks on Button1_Click to re-submit the new value of Address1.Text is not passed. It's the old value. What I want is to pass the new value.
I'm sure this is by design, but I don't know how to get it to do what I need it to do. I can't seem to figure out whether I have my events mixed up, or whether it's something to do with post/postback method, or session variables, or what???
I am aware that the mult-view control is supposed to handle this situation more elegantly, but I am trying to work with an existing design without wasting time doing a full page redesign on something that will be scrapped soon anyway.
Code:
Protected Sub Button1_Click
Call createPage1Array()
dsAdd_NewAccount.Insert()
Response.Redirect("page2")
End Sub
This captures the values entered by the user in a session variable so the app will remember the input values:
Code:
Sub createPage1Array()
Dim page1Array(3) As String
page1Array(0) = Me.Company.Text
page1Array(1) = Me.Address1.Text
page1Array(2) = Me.Address2.Text
Session("page1Array") = page1Array
End Sub
The intent is to handle if the user submits to page2 and then suddenly realizes "oops, i messed up something on page1, let me go back"
On page2, there is a "GoBack" button whose btnGoBack_Click event is:
Code:
Response.Redirect("page1?GoBack=True")
and on page_load of page1, I have
Code:
If Request.QueryString("GoBack") = "True" Then
Me.CompanyLegalName.Text = Session("page1Array")(0)
Me.Address1.Text = Session("page1Array")(1)
Me.Address2.Text = Session("page1Array")(2)
End If
which serves to re-populate the textboxes with the originally entered values.
PROBLEM: When the user makes a change to, say Address1.Text, and then clicks on Button1_Click to re-submit the new value of Address1.Text is not passed. It's the old value. What I want is to pass the new value.
I'm sure this is by design, but I don't know how to get it to do what I need it to do. I can't seem to figure out whether I have my events mixed up, or whether it's something to do with post/postback method, or session variables, or what???
I am aware that the mult-view control is supposed to handle this situation more elegantly, but I am trying to work with an existing design without wasting time doing a full page redesign on something that will be scrapped soon anyway.