Problem applying data annotation in asp.net mvc2
- by Fraz Sundal
Im facing problem when trying to apply data annotation. In my case im passing FormCollection in controller
[HttpPost]
public ActionResult Create(string Button, FormCollection collection)
{
if (ModelState.IsValid)
{
}
else
{
}
}
and in ModelState.IsValid condition always have true value. Although i have left some blank fields in View. Also EnableClientValidation() is also applied in View for client side validation but its not working. what may be the problem