Tag: html post

如何使用method =“post”从表单中获取数据? 如何在我的控制器中请求数据?

我试图从我的HTML代码中获取数据,如“acquringCode”,“cardAcceptor”和“merchantId”。 我无法想象如何在我的控制器中获取该数据。 我知道它的request.form。 我相信我做错了。 有没有更简单的方法让我通过函数传递对象或每个名称作为参数? HTML $(document).ready(function () { $(“#SavetreventLocationLookupAddButton”).click(function () { $(“#addSaveTreventLocationLookup”).submit(); }); }); 添加Trevent位置查找 <form id="addSaveTreventLocationLookup" method="post" action="”> Trevent Location Lookup Detail Acquiring Institution Identification Code: Card Acceptor Identification Code: Merchant Id: Add Cancel 位指示 [HttpPost] [AuthorizeAttribute(AdminRoles = “AddTreventLocationLookup”)] public ActionResult AddSaveTreventLocationLookup() { try { string acquiringInstitutionIdentificationCode; //= Request.Form[“AcquiringInstitutionIdentificationCode”] ?? string.Empty; string cardAcceptorIdentificationCode;// […]