Question

I don't know it's even possible but I try to achieve to post data from one page to another using the second form.
The problem is I need a form tag for the user interface containing callback panels etc. I want to put a second form with some hidden-field:

<form id="postForm" method="post" action="target.aspx">
    <input type="hidden" id="id" />
</form>

I submit the form from javascript with jquery:

$("#id").val(id);
$("#postForm").submit();

Is there a way access the value of the hidden field on the target page?

Was it helpful?

Solution

You should give the hidden field a name attribute:

<input type="hidden" id="id" name="id" />

You'll then be able to use Request.Form in your target page to access the posted data:

string postedId = Request.Form["id"];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top