Asp.net MVC client side model validations step by step

Posted by Unknown
Asp.net MVC client side model validations

In this post am going to explain you about client side model validations in asp.net MVC
in MVC 2.0 or avove versions  we have bunch of features that we can enable many features at client side
in that one of the most important and useful was model validation at client side with help of unobtrusive validation jquery.

with this unobtrusive jquery we can do the validations based on the data annotations which are applied on the model classes.

In order to enable client side model validation we need a two jquery references see the image bellow 

in MVC 2.0 we need to add these two references 

image

If you are in MVC 3.0 or avove use
                       "~/Scripts/jquery.unobtrusive.js",
                        "~/Scripts/jquery.validate.js"

here is the step by step implementation for client side model validation see bellow


image



















image




image



image



image



image




image

image

image




image


hope this will helps you


Labels: ,

Post a Comment

 
test