我需要在ASP.NET MVC 4(C#)应用程序中使用远程验证来验证FirstName,LastName和Email Address组合的副本。远程验证只接受一个AdditionalFields,如下所示:
[Remote("IsUserNameAvailable", "User", AdditionalFields="LastName" )]
public string FirstName{ get; set; }
public string LastName{ get; set; }
public string EmailAddress{ get; set; }
如何为组合添加EmailAddress?
答案 0 :(得分:42)
您可以用逗号分隔它们:
[Remote("IsUserNameAvailable", "User", AdditionalFields="LastName,EmailAddress" )]