Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique validation
Message
 
 
À
28/12/2012 04:42:39
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01560641
Message ID:
01560800
Vues:
40
>>Could the problem be that the Id is "Name" but the name is "Client.Name"
>>
>>?
>Don't know why id is "Client.Name" but make sure that the parameter name in the validation method exactly matches the control id. i.e.:
public JsonResult doesClientNameExist(string Name)
>    {
>    }
If it doesn't you will get null for sure....

I found that it was indeed the reason that I had in my ViiewModel

public Client Client {get;set'}

and then it didn't work. After I added two properties directly Name and Number to that view model, it worked.

The other problem is that these validaions fire on each keystroke instead of when I exit the field. I believe this is happening due to me using a modal dialog to show the form. I still want to prevent this behavior.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform