How to get the value of a hidden field in another form
If your Form1.aspx is submitted to Form2.aspx, you have at least several ways to access the value of the form fields (including hidden fields):
-
The Request.Form property provides a
NameValueCollection
containing all the form field names as keys and their values as values. You can use syntaxRequest.Form["fieldName"]
to access the value. -
If it's ASP.NET 2+ and you've used the multi-page wiring technique, you should be able to access the field values on the previous page using the
PreviousPage
page property . -
If you are using
Server.Transfer
, you can access the values using CurrentHttpContext
.
If you need more information, you should take a look at Passing values between pages in ASP.NET .
a source to share
Hmm ... you need to think about the difference between servers and clients first ... You cannot directly access the changes you made on the client on the server because you are sending the request to the server as the response you receive in your browser. Once you receive the request, the server will shut down and will no longer be able to access the site. It's like a letter that you send. Once you put it in the mailbox, you can no longer make changes. But you can send a new request to the server and add POST or GET peremeters. Access to them is possible by the server. The way the request is sent doesn't matter ... you can send the request with AJAX or just reload the page.
a source to share