I am using Remote validation on two field Email and CNIC.Remote Validation work proper but when i clik on submit button form not post.When i remove remote validation on both of fileds form post the data.
Model
Public class VMModel
{
Remote("Function","Controller",ErrorMessage = "The CNIC already exists")]
public string CNIC { get; set; }
[Remote("Function2", "Controller", ErrorMessage = "The Email already exists")]
public string Email { get; set; }
}
Controller
public JsonResult Function2(string Email)
{
bool IsExist = true;
if (Membership.GetUser(Email) != null)
{
IsExist = false;
}
return Json(IsExist, JsonRequestBehavior.AllowGet);
}
public JsonResult Function(string CNIC)
{
bool IsExist = true;
if (GetUserByCNIC(CNIC) != null)
{
IsExist = false;
}
return Json(IsExist, JsonRequestBehavior.AllowGet);
}