ユーザー名用とパスワード用の 2 つのフィールドを持つ単純なユーザー登録フォームがあります。UserController次の2つのアクションを持つコントローラーがあります。
[HttpGet]
public ActionResult Register()
{
return View();
}
[HttpPut]
public ActionResult Register(string username, string password)
{
// Registering user
return View();
}
HTTP Putを使用して Web サイトを RESTful にしました (PUT 動詞で挿入)。ただし、フォームを送信すると、404 エラーが発生します。ここに私のフォームのHTMLがあります:
<form action='@Url.Action("Register", "User")' method="post">
<div class='field'>
<label for='username'>
Username:
</label>
<input type='text' id='username' name='username' maxlength='100' />
</div>
<div class='field'>
<label for='password'>
Password:
</label>
<input type='password' id='password' name='password' maxlength='50' />
</div>
</form>
ここで何が恋しいですか?どうしたの?