Hi Lakshmi,
After seeing your code everything seems to be perfect, except controller.Since you missed to post it here.
In your action do you have modelstate.isValid like this
public ActionResult actionName(class1 clsObj)
{
if(ModelState.IsValid)
{
// TODO: Add your own logic here
}
else
{
return View(clsObj);
}
}
Updated solution after your comments,
Hey, in ASP.NET MVC3, there's no need to add Html.EnableClientValidation() in view page, instead, just enable the clientValidation in the webconfig file as below:
<appSettings>
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
Hope this helps you a bit.
Regards,
RK