How do I pass information back and forth in an asp.net web application throught the html forms? I know how to do this in PHP, but I can’t seem to think about it through the code-behind thing (i think that’s what its called).
(note: i only started looking at asp.net a few hours ago. i decided to try it by recreating a simple page)
How do I pass information back and forth in an asp.net web application throught
Share
You can post to an ASP.NET page with a standard HTML form like this:
Then in the code behind of MyPage.aspx, you can access the form elements like this:
It should also be noted that most ASP.NET books would probably teach posting back to the same page. You can then access the form items on the page via the objects, then do a Response.Redirect() to the next page you want to go to.
In this case the aspx would look like this:
And you would access the value from the codebehind like this: