Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique validation
Message
 
 
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01560641
Message ID:
01560800
Views:
39
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform