Cuando pulso el botón submit no responden los Helpers. Evidentemente algo falta pero no se qué es. La idea es que los Helpers hagan su evaluación y si esta todo bien, despues se enviarán los datos al Controlador. Aca el código.
@using (Html.BeginForm("RegistrarUsuario", "Usser", FormMethod.Post, new { name = "f1" }))
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Guardar" class="btn btn-default" />
</div>
</div>
</div>
}
Aca la clase Usser.
public class Usser
{
[Required(ErrorMessage = "Please enter student name.")]
public String Name { get; set; }
[Required(ErrorMessage = "Please enter student name.")]
public String Surname { get; set; }
[Required(ErrorMessage = "Please enter student name.")]
public DateTime dateTime { get; set; }
[Required(ErrorMessage = "Please enter student name.")]
public String Email { get; set; }
[Required(ErrorMessage = "Please enter student name.")]
public String UsserName { get; set; }
[Required(ErrorMessage = "Please enter student name.")]
public String Pass { get; set; }
[Required(ErrorMessage = "Please enter student name.")]
public String Address { get; set; }
[Required(ErrorMessage = "Please enter student name.")]
public int AdminType { get; set; } //Tipo de admin: "1" es administrador. "2" Usuario.
[Required(ErrorMessage = "Please enter student name.")]
public int Estado { get; set; }
}