We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


ASP.NET  w/ VB  Pass data in textbox on page into Labels on another page

aninec asked
Medium Priority
Last Modified: 2012-05-06
The user enters data into 6 textboxes and then clicks continue.  The data in the textboxes then pass to labels on another page.  I have done this with a gridview and hyperlinkfields - not sure how to do this with textboxes.

This is sensitive information so query string would nto be the best choice from what I have read.
Watch Question

Top Expert 2005

Any reason you wouldn't first save the data to the database, then on the label page, you load and display.


Yes - I dont want to save the data until the user has completed the second page.  I just want to pass this info into the second page so that user can refer back to it if needed.
Top Expert 2005
Time to break out the Session Object then...

On the page you enter information, after they submit
Session("myValue") = myTextBox.Text

On the label Page
myLabel.Text = Session("myValue").ToString()

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


What about using PreviousPage?  Is this secure?

If PreviousPage IsNot Nothing AndAlso PreviousPage.IsCrossPagePostBack Then
                        Dim text1 As Textbox = CType(PreviousPage.FindControl("txtLast"), TextBox)
                  If text IsNot Nothing Then
                PtName.Text = text.Text
            End If
        End If
Top Expert 2005

I think that'll work, however, I've not had much experience with it.  In order to use that, your first page, is going to have to post to the second page.  This is much different than the default behavior of asp.net pages, and if you haven't already configured that, you might be better off using the Session.


With the Session..is this on the users machine only?  Meaning I could have 5 users accessing the same page at the same time - entering the same data.
Top Expert 2005

Session is per-user, and it's stored on the server.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.