This might be a trivial question, me being a new bee :) Here is my View code
<button type="button" id="btnLogin" onclick="location.href='<%: Url.Action("Authenticate", "Login") %>'" runat="server"></button>
Here is my Controller code
public ActionResult Authenticate(string username,string password)
{
bool status = Login.Authenticate(username, password);
return View("Status", status);
}
I'm able to go to that controller but i'm unable to pass the parameters.Can any let me know what is the rite way to pass parameters to controller function.
Full View Code
<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>
<input type="text" id="username" name="username" />will match withstring username