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

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -