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

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - On Gitbash - Bower : ENOGIT git is not installed or not in the PATH -