31

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?

1 Answer 1

54

You could separate them by comma:

[Remote("IsUserNameAvailable", "User", AdditionalFields="LastName,EmailAddress" )]
Sign up to request clarification or add additional context in comments.

1 Comment

N.B. If you want this to actually be revalidated when the additional fields change you will want to look at @Kiff's answer here stackoverflow.com/questions/10163683/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.