Accessing form data in to controller using parameters ?

Sunny.Sagar
Posted by Sunny.Sagar under ASP.NET MVC category on | Points: 40 | Views : 2376
  [HttpPost]
public ActionResult ReceiveWithParameter(string txtUserName,
string txtPassword)
{
if (txtUserName.Equals("user",
StringComparison.CurrentCultureIgnoreCase) && txtPassword.Equals("pass", StringComparison.CurrentCultureIgnoreCase))
{
return Content("Login successful !");
}
else
{
return Content("Login failed !");
}
}

The parameters name of this action method are same as the name of the element

Comments or Responses

Login to post response