Filed under ASP.NET MVC 3
We can directly apply the validation by using jquery.validate.unobtrusive.min.js without using the model class.
By adding html markup you can enable the client side validation.
In your View this is how it looks like in your input text.
First add the jquery scripts.
<script type="text/javascript" src="/Scripts/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/Scripts/jquery.validate.min.js"></script>
<script type="text/javascript" src="/Scripts/jquery.validate.unobtrusive.min.js"></script>
Then your input text
<input type="text" name="name" id="name" value="val" data-val="true" data-val-required="required" />
There very simple classic approach ^_^
Happy Coding
1c78e4b6-e02f-49b7-baaf-c272091d60ba|0|.0