Remote validation is not working for Area using mvc 5

303 views Asked by At
[Display(Name = "Campus Name")]
[Required(ErrorMessage = "Campus Name is required")]
[Remote(controller:"School",action: "checkCompusNameExists",areaName:"SetUp",ErrorMessage ="Campus Name Already Exist")]
public string CampusName { get; set; }


public JsonResult checkCompusNameExists(string Compus)
{
    return Json(!db.Schools.Any(x => x.CampusName == Compus), JsonRequestBehavior.AllowGet);
}

I am using Meta Data Class and Partial Class for Validate my Model...... and now i have an Area with the Name of "SetUp" and i generate my model in main project root.. all validate are working good but when i try to validate for unique campus name then it's not working..... any body is there who help me. There is my json Action and my validate class

0

There are 0 answers