Я использую плагин проверки jquery, и атрибут remote работает с emailId, а не с mobileNo?
var validator = $("#addform").validate({
rules: {
Name: "required",
MobileNo: {
required: true,
minlength: 10, remote: '<%=Url.Action("getClientMobNo", "Clients") %>'
},
Address: "required"
},
messages: {
Name: "please provide a client name",
MobileNo: {
required: "Please provide a mobile phone no",
rangelength: jQuery.format("Enter at least {0} characters"),
remote: jQuery.format("This MobileNo is already in use")
},
Address: "please provide client address"
},
Значение null
передается в действие моего контроллера. Любое предложение ...
public JsonResult getClientMobNo(string mobno)
{
JsonResult result = new JsonResult();
string status = clirep.getClientMobNo(Convert.ToInt64(mobno));
if (status == "Mobile No already exists")
{
result.Data = false;
}
else
{
result.Data = true;
}
return result;
}