Asp.netでMVC3を使用していますが、HTTPPOST日付をコントロールに送信する必要があります。コントロールは、応答として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>