Thread: Pass a Value

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Orlando
    Posts
    2
    Rep Power
    0

    Pass a Value


    I need to pass a value from one TextBox on a WebForm to another TextBox on another WebForm. I am rather new to C# and I am having difficulty performing this task. Any help is greatly appreciated.

    Thanks,

    Dave
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    Redmond, WA
    Posts
    218
    Rep Power
    15
    It's not as hard as you think. All you have to do is traverse from the first webform to the second webform and in the page_load event handler on the second form, access the index pertaining to the name of the text field that you desire to retrieve data from.

    Suppose on the first page, you have a field named 'address' and you want that information to show up in a similar field on the second page, you'd type the following:
    Code:
    nameOfTextFieldOnSecondPage.Text = HttpApplication.Request.Form[ "address" ].ToString();
    Keep in mind that you will need to post the information to the second page in order to use the Request.Form indexer.

IMN logo majestic logo threadwatch logo seochat tools logo