Posting form data to another page

Discussion in 'ASP.NET / ASP.NET Core' started by mjtee, Jan 12, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I've searched and searched for an easy solution to this problem, but I can't find one. Is there any straight forward way (using ASP.NET not Classic ASP) to post data in a form on one page, to another page. I've figured out that I can use a Property to retrieve it, but there's got to be another way.

    So as an easy example, say i have a textbox and a submit button on a page called form1.aspx and i want to post the name submitted in the textbox to a label object on form2.aspx, what would be the best way to do this?

    Thanks in advance.
     
  2. I hear where you are coming from, but this is one of the changes in coding you have to grasp going from ASP to ASP.Net, what you should be asking yourself is why do I want to do this ? (my god im sounding to deep!) you might need to look at the structure of your application, but anyway


    on the PostBack event for the Buttonon page1.aspx, just do something like


    Server.Transfer("page2.aspx?TextBoxValue=" & TextBox1.Text)


    or you can use Response.Redirect... whichever.


    Michael
     
  3. Thanks for the reply Michael. Actually, strangely enough before I read your post, I went back to my code, made a couple of structural changes and saved SO MUCH TIME and resources. And those changes allowed me to accomplish what I wanted to do without having to postback.


    But thanks for your recommendation. It was spot on.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page