I have a problem when executing a request to insert a new user, I do not know what I need to do now to finish my request, By clicking the register button nothing happens below are my HTML code and controller (Controller Name: UserController)
<form data-toggle="validator" role="form">
@Html.AntiForgeryToken()
<div class="form-group">
@Html.LabelFor(model => model.Nome, htmlAttributes: new { @class = "control-label" }) <br>
@Html.EditorFor(model => model.Nome, new { htmlAttributes = new { @class = "form-control", id = "Nome", placeholder = "Nome", required = "required" } })
@Html.ValidationMessageFor(model => model.Nome, "", new { @class = "text-danger" })
</div>
<!-- Confirmação de password -->
<div class="form-group">
@Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label" }) <br>
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control", id = "Email", type = "Email", placeholder = "Email", required = "required" } })
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "help-block with-errors" })
</div>
<div class="form-group">
@Html.LabelFor(model => model.Senha, htmlAttributes: new { @class = "control-label" }) <br>
<div class="form-inline row">
<div class="form-group col-sm-6">
@Html.EditorFor(model => model.Senha, new { htmlAttributes = new { @class = "form-control", id = "inputPassword", placeholder = "Password", required = "required", minlenght = "6", type = "password" } })
@Html.ValidationMessageFor(model => model.Senha, "", new { @class = "help-block with-errors" })
</div>
<div class="form-group col-sm-6">
<input type="password" class="form-control" id="inputPasswordConfirm" data-match="#inputPassword" data-match-error="Opa, as senhas não batem" placeholder="Confirm" required>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="form-group">
@using (Html.BeginForm("Adicionar", "Usuario", FormMethod.Get))
{
<button type="submit" value="Create" class="btn btn-success">Cadastrar</button>
}
<button type="button" class="btn btn-success" id="btn-login">Login</button>
</div>
</form>
< > // GET: User [HttpGet] public ActionResult Index () { return View ("Index", Repo.List ()); }
[HttpPost]
public ActionResult Adicionar(Usuario user)
{
Repo.Adicionar(user);
return View("Index");
}
[HttpPost]
public ActionResult Atualizar(Usuario user)
{
Repo.Atualizar(user);
return View("~\Views\Principal\Principal.cshtml");//?
}
// DELETE : Usuario
[HttpDelete]
public ActionResult Delete(int id)
{
Repo.Deletar(id);
return View("Index", Repo.Listar());
}