Hi All
I am trying to use validations with ASP.NET MVC 2. I am just validating a textbox value. Below is my approach. Create View -:
<%: Html.ValidationSummary(true)%>
<%: Html.TextBoxFor(model => model.Name, new { @class="input-standard"})%>
<%: Html.ValidationMessageFor(model => model.Name) %>
Model Property-:
[Required (ErrorMessage="Name Required")]
public virtual string Name { get; set; }
But if i keep the textbox empty and click on submit then still the ModelState.IsValidate prperty is returning true.
Please suggest what am i doing wrong.
Thanks.