简体   繁体   中英

Sending data with form and reading it from Request.Form

I have form like below in mvc view:

<form name="aspnetForm">
    <input type="hidden" id="ORDER_ID" name="ORDER_ID">
    <input type="hidden" id="STATUS" name="STATUS" value="SHOW">
</form>

I want to send it from js with below:

function send(orderKeyId, sUrl) {
    document.aspnetForm.ORDER_ID.value = encodeURIComponent(orderKeyId);
    document.aspnetForm.action = sUrl;
    document.aspnetForm.submit();
}

Everything works, but I have to read it in aspx.cs from Request.QueryString , but I need to use Request.Form because of I need clear url without any queryString inside. I mean, it automatically add ORDER_ID to queryString instead of sending it in form.

您在Request.Form["ORDER_ID]缺少右引号

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM