数据作为查询字符串而不是表单数据发送

时间:2012-11-01 19:19:06

标签: asp.net-mvc form-data

在我的表单中,我看到数据是作为Querystring发送的,而不是表单数据(我期望它)。

我的页面:

@using (Html.BeginForm("AAForm", "Test", FormMethod.Post, new { id = "myAForm" }))
{
   <label for="a">A</label>
   <input id="aid" name="aname" style="width: 300px" required validationMessage="Select"/>
   <button type="submit" class="btn btn-primary" value="aa" > Go </button>
   }

ControllerSignature

  

public ActionResult GetValues(FormCollection formCollection){   //一些代码}

我正在对GetValues()进行AJAX调用。

我可能做错了什么?请告诉我是否应该发布更多信息。

另一个问题:查询字符串中的“_:”是什么?它有一些随机数值。

感谢。

1 个答案:

答案 0 :(得分:1)

[HttpPost]上添加ActionResult属性。

相关问题