i am system.datamodel.dataannotation for validating my views.
below is my Model for the view.
using System.ComponentModel.DataAnnotations;
public class LoginVM
{
[Required(ErrorMessage="Please provide UserName")]
public string UserName { get; set; }
public string Password { get; set; }
}
below is my view for Login
<% using (Html.BeginForm())
{ %>
<% Html.ValidationSummary(true); %>
<div style="width: 100%; height: 100%; border-style: none;">
<fieldset style="border-style: none;">
<table style="width: 100%; height: 100%; border-style: none;" border="0">
<tr>
<td style="height: 100px;" colspan="4">
</td>
<td class="editor-label" style="width: 35%; font-size: medium; vertical-align: top;
text-align: justify;">
<%: Html.Label("Sign in with your Account Credentials")%><br />
<br />
<a href='<%= Url.Action("LogOn","Site") %>' class="header-links">Support / Contact Us</a>
</td>
<td style="width: 5%;">
</td>
<td style="width: 60%; border-left-width: 2px; border-left-color: #E3E3E3; border-left-style: solid;">
<table style="border-style: none;" border="0">
<tr>
<td colspan="3">
</td>
</tr>
<tr style="height: 30px;">
<td style="width: 20%;" class="login-display-label">
<%: Html.LabelFor(m=>m.UserName,"UserName :") %><br />
<br />
<%: Html.LabelFor(m=>m.Password,"Password :") %><br />
<br />
</td>
<td style="width: 182px;" colspan="2">
<%: Html.TextBoxFor(m=>m.UserName,"UserName :")%><br />
<%: Html.ValidationMessageFor(m=>m.UserName) %><br />
<%: Html.TextBoxFor(m=>m.Password,"Password :")%><br />
<%: Html.ValidationMessageFor(m=>m.Password) %><br />
</td>
</tr>
<tr>
<td>
 
</td>
<td style="width: 182px;" colspan="3">
<input type="button" id="btnSubmit" value="Submit" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
below is the scripts i have putted on my view as well as my site.master page
<script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.unobtrusive.js" type="text/javascript"></script>
i have also checked my web.config for below markup
<appSettings>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
after lots of effort my validation doesnt occur please help me....
let me known what necessary change i have to make.
thnaks in advance