开发者

Calling a IValidateObject Validate method from client Side MVC3

I am very new to MVC and I am using MVC 3 in our Project..

I implemented Model level validation using IValidateObject..and I created the Validate method with some validation logic on my model...

I saw some other interface called Iclientvalidatable for calling validation methods from jquery validation(client side)..

Now I am trying to call the Validate method from client side...Is it possible??

Do I need to implement Iclientvalidatable interface on same model and needs to write the same logic in this method also??

Or Can I directly access the validate method from IClietnValidatable method??

My goal is accessing the validate method logic from client side..If its not possible to do..then i 开发者_如何转开发need to write same logic on client side also...

Please help me..thanks..


You cannot link class level validators to client side validation.

See IValidatableObject in MVC3 - client side validation


If you want custom client side validation you need to implement the IClientValidatable interface but the actual validation logic should be done using javascript. And here's another example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜