My MVC 4 validation is working as it seems, the error messages pop up, but it still submits the form. Any idea what I am missing? Thank you.
public class StatusRequestModel
{
[Required]
[Display(Name = "Ticket Number")]
public int? TicketNumber { get; set; }
[Required]
[Display(Name = "Postal Code")]
public int? PostalCode { get; set; }
}
@using (Html.BeginForm())
{
@Html.ValidationSummary()
@Html.LabelFor(x => x.TicketNumber)
@Html.TextBoxFor(x => x.TicketNumber)
@Html.LabelFor(x => x.PostalCode)
@Html.TextBoxFor(x => x.PostalCode)
<input type="submit" value="Submit" />
<input type="reset" value="Reset"/>
}