October 22nd, 2003, 11:38 AM
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.
October 26th, 2003, 11:49 PM
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:
Keep in mind that you will need to post the information to the second page in order to use the Request.Form indexer.
nameOfTextFieldOnSecondPage.Text = HttpApplication.Request.Form[ "address" ].ToString();