我在 Asp.net 中使用 MVC 3 我需要将 HTTP POST 日期发送到控件。控件应该发回一些 JSON 作为响应。目前我正在使用此代码,但我无法在collection
.
知道有什么问题吗?
[HttpPost]
public JsonResult LogOn(FormCollection collection, string returnUrl)
{
...
return this.Json(new { success = "true", msg = messages[0] });
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<h1>
Test LogOn</h1>
<form action="/Controller/LogOn" method="post">
UserName:
<input type="text" name="UserName"><br>
Password:
<input type="text" name="Password"><br>
RememberMe:
<input type="hidden" name="RememberMe" value="true">
<input type="submit" value="Submit">
</form>
</body>
</html>