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