I have a controller that has two Actions;
public ActionResult Cadastrar()
{
return View();
}
//[ValidateAntiForgeryToken]
[HttpPost]
public ActionResult Cadastrar(Usuario usuario)
{
if (ModelState.IsValid)
{
var appUsuario = new UsuarioAplicacao();
appUsuario.Salvar(usuario);
return RedirectToAction("Index");
}
return View(usuario);
}
And I have this view
@using (Html.BeginForm("Cadastrar","Usuario",FormMethod.Post))
{
código código código
<input type="submit" value="Cadastrar" class="btn_login" />
}
When I click submit on the registration page it goes to the same page sending by get the values of the form:
And when this happens it calls the register by get and the cycle repeats itself.
I can not register at all, does anyone have any tips?