これは些細な質問かもしれません。私は新しい蜂です:)これが私のViewコードです
<button type="button" id="btnLogin" onclick="location.href='<%: Url.Action("Authenticate", "Login") %>'" runat="server"></button>
これが私のコントローラーコードです
public ActionResult Authenticate(string username,string password)
{
bool status = Login.Authenticate(username, password);
return View("Status", status);
}
そのコントローラーに行くことはできますが、パラメーターを渡すことができません。コントローラー関数にパラメーターを渡すための儀式的な方法を教えてください。
フル ビュー コード
<table>
<tr>
<td>
<input type="text" id="txtUsername" runat="server" />
</td>
<td>
<input type="text" id="txtPassword" runat="server" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<button type="button" id="btnLogin" onclick="location.href='<%: Url.Action("Authenticate", "Login") %>'" runat="server"></button>
</td>
</tr>
</table>