Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,
Currently i am facing a problem related to MVC 4 Remote Validation.

I have 1 models Name UserModel along with remote validation
C#
[DataType(DataType.EmailAddress)]
       [StringLength(50)]
      [Remote("IsNameExists", "User", ErrorMessage = "Login ID/Email Already is in use.")]
       public string UserLogon
       {
           get;
           set;
       }


Now ,above models being used by Multiple view like User & Signup , both views have same model value like
@Html.TextBoxFor(model => model.UserLogon,
new { placeholder = "Enter Email", @class = "inputSPCL", @maxlength = "50" })
@Html.ValidationMessageFor(model => model.UserLogon)

But problem is that, above Remote validation fired for User View but not working
for Signup.

Can any one please help me on this?

Regards
Posted
Comments
John C Rayan 12-Jan-16 7:09am    
Can you show us your User and Signup Views ?
Raje_ 12-Jan-16 7:57am    
also can you share your IsNameExists method?

1 solution

It is worth reading this article from

How to: Implement Remote Validation in ASP.NET MVC[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900