Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use multiple AdditionalFields in remote validation - asp.net mvc

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; }

How can i add the EmailAddress for the combination?

like image 925
Prasad Avatar asked Nov 08 '11 06:11

Prasad


1 Answers

You could separate them by comma:

[Remote("IsUserNameAvailable", "User", AdditionalFields="LastName,EmailAddress" )]
like image 131
Darin Dimitrov Avatar answered Nov 08 '22 05:11

Darin Dimitrov