本文介绍了如何使用远程验证多个AdditionalFields - asp.net mvc的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要验证名字,姓氏和电邮地址组合在我的ASP.NET MVC 4(C#)应用程序中使用远程验证重复。远程验证只接受一个AdditionalFields,这是如下:

I need to validate the duplicate of FirstName, LastName and Email Address combination using remote validation in my ASP.NET MVC 4 (C#) application. The Remote Validation accepts only one AdditionalFields, which is as below:

 [Remote("IsUserNameAvailable", "User", AdditionalFields="LastName" )]
 public string FirstName{ get; set; }
 public string LastName{ get; set; }
 public string EmailAddress{ get; set; }

我如何可以添加EmailAddress的为组合?

How can i add the EmailAddress for the combination?

推荐答案

您可以用逗号分隔它们:

You could separate them by comma:

[Remote("IsUserNameAvailable", "User", AdditionalFields="LastName,EmailAddress" )]

这篇关于如何使用远程验证多个AdditionalFields - asp.net mvc的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-14 18:59