c# - MVC Remote Validation Additional fields naming -
i have remote validation postal code field , country id passed additional field. following code:
public jsonresult isvalidpostalcodeforcountry(string companypostalcode, string companycountryid) { //my validation code return json(true, jsonrequestbehavior.allowget); }
model:
[postalcoderemotevalidation("isvalidpostalcodeforcountry", "common", "", additionalfields = "companycountryid")] [required(errormessageresourcename = "valpostalcoderqrd")] public string companypostalcode { get; set; } [required(errormessageresourcename = "valcountryrqrd")] public int companycountryid { get; set; }
can names action parameter , names in model property different?
why want this?
call same remote validation method different models name of property can different.
Comments
Post a Comment