Suppose i have two text fields in one page, one for name and another one for age.
When i click the submit button those values should appear in another page. Can any one give the example for that one.. i am totally confused.
please help me Thank you
MSDN has a page on this, How to: Pass Values Between ASP.NET Web Pages:
For your scenario, it sounds like using POST is the way to go, since you have textboxes on the first page. Example:
First page:
Notice the
action="WebForm2.aspx"
which directs the POST to the second page. There's no code-behind.Page 2 (receiving page):
Notice the
EnableViewStateMac="false"
attribute on the Page element. It's important.The code-behind, grabbing the values using a simple
Request.Form()
:That should work... :)