I had a problem with an elementary post sending request. While I googled, even more confused. Either the extension .aspx, then cshtml. My brain is already boiling.
I have a users model. This model contains the following properties: Name and LastName
class Users { public string Name{ get; set; } public string LastName { get; set } } Also in the UsersController controller, there is a RegisterUser method, which takes an object of the Users class as a parameter.
public ActionResult RegisterUser(Users user) { //какие-то действия з БД и т.д. return View("Registration completed"); } There is also a form:
<form method="post" action=""> <input type="text" name="Name"> <input type="text" name="LastName"> <input type="Submit">Register</input> </form> I don't know what to write to the action property so that the RegisterUser function is called.