In an .aspx page I'm filling out a number of hidden form fields with JavaScript and then want to post the form to another .aspx page. It submits the form properly but when I look at the Request.Params["org"] in the page that was called in the form's action it's null.
<script src="prototype.js"></script>
<script>
function doIt() {
$('org').value = org_int;
$('frmCheckout').submit();
}
</script>
...
<form id="frmCheckout" method="post" action="checkout.aspx">
<input type="hidden" value="" id="org" name="org">
<input type="submit" onclick="doIt()" value="Submit">
</form>
$ is the prototype notation which was brought in before the example. $ in prototype is the same as document.getElementById('frmCheckout').
MAJOR EDIT 2/1/2021 7:52: Looking for the solution I found a couple of new bits of information but it still doesn't work.
I found PostBackUrl which will change the .aspx's action to another .aspx page. This part works. When submitted, it calls Checkout.aspx
<asp:Button ID="Submit" PostBackUrl="Checkout.aspx" runat="server" Text="Submit" />
But the data is not available in Checkout.aspx... there are no values in Request.Form (which there is supposed to be) or Request.Params.
I've also tried:
<asp:TextBox runat="server" name="jsonString" id="jsonString" value="js" />
But I'm getting an invalid __VIEWSTATE I know I'm supposed to change it but nothing has worked yet.