Seems like you commented out your code. Also, you need to put your code inside your
Button
's
Click
event instead of
Page_Load
. You can try something like this:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Dim ar As New ArrayList()
ar.Add("Όνομα: " & firstNameTextBox.Text)
ar.Add("Επώνυμο: " & lastNameTextBox.Text)
ar.Add("E-mail: " & emailTextBox.Text)
ar.Add("E-mail: " & phoneTextBox.Text)
ar.Add("Βιβλίο: " & booksDropDownList.SelectedValue)
ar.Add("Λειτουργικό Σύστημα: " & osRadioButtonList.SelectedValue)
Session("InputData") = ar
Response.Redirect("Result.aspx")
End Sub
Then in your Result.aspx page, you can reference the data like this:
Private Sub Results_Load(sender As Object, e As EventArgs) Handles Me.Load
If Session("InputData") IsNot Nothing Then
Dim data As ArrayList = CType(Session("InputData"), ArrayList)
outputListBox.DataSource = data
outputListBox.DataBind()
End If
End Sub
Note that
Sessions
is just one of the option to transfer data from one page to another. You can also use either:
1. Server.Transfer() method
2. PostBackURL of a Button
3. QueryStrings
4. POST Request