Results 1 to 3 of 3

Thread: How can I show the user input to another page in ASP.NET (in VB.NET)

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2019
    Posts
    2

    How can I show the user input to another page in ASP.NET (in VB.NET)

    I have a page WebControls.aspx. I have some textBox in that page. I want to show that data in other page (Results.aspx) when the user click a button. I have this code but not working...
    Code:
    'WebControls.aspx
       Private Sub WebControls_Load(sender As Object, e As EventArgs) Handles Me.Load
           If IsPostBack Then
               Dim firstName As String = firstNameTextBox.Text
               Session.Add("Όνομα: ", firstName)
               Session.Add("Επώνυμο: ", lastNameTextBox.Text)
               Session.Add("E-mail: ", emailTextBox.Text)
               Session.Add("Τηλέφωνο: ", phoneTextBox.Text)
               Session.Add("Βιβλίο: ", booksDropDownList.SelectedItem.ToString)
               Session.Add("Λειτουργικό Σύστημα: ", osRadioButtonList.SelectedItem.ToString)
    
    
               '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
           End If
    
       End Sub
    
    'Results.aspx
        Private Sub Results_Load(sender As Object, e As EventArgs) Handles Me.Load
            For Each keyName In Session.Keys
                outputLabel &= (keyName & Session(keyName))
            Next
            'Dim ar As New ArrayList()
            'ar = Session("InputData")
            'outputListBox.DataSource = ar
            'outputListBox.DataBind()
    
        End Sub
    Last edited by Shaggy Hiker; Apr 8th, 2019 at 09:15 AM. Reason: Added CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width