I am using validation controls in asp.net application, I got this following webforms unobtrusivevalidationmode error while running the application.
Aspx Codes(Html ):
<form id="form1" runat="server">
<div>
<table align="center" style="border: 1px solid #dbcece">
<tr>
<td colspan="3"
style="text-align: center; font-weight: 700; border-bottom-style: solid;
border-bottom-width: thin; border-bottom-color: #008080;">User Login Area</td>
</tr>
<tr>
<td > </td>
<td > </td>
<td> </td>
</tr>
<tr>
<td >UserName :</td>
<td >
<asp:TextBox ID="txtusername" runat="server" Width="120px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtusername" ErrorMessage="Please, enter username"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td >Password :</td>
<td >
<asp:TextBox ID="txtpassword" runat="server" TextMode="Password" Width="120px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtpassword" ErrorMessage="Please, enter password"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td > </td>
<td >
<asp:Button ID="btnlogin" runat="server" OnClick="btnlogin_Click"
Text="Login" />
</td>
<td> </td>
</tr>
<tr>
<td > </td>
<td colspan="2">
<asp:Label ID="lblmsg" runat="server"></asp:Label>
</td>
</tr>
</table>
</div>
</form>
Solution: Here, I am using asp validation on the design page,so that we need to enable the validation mode in the web.config file. Add key and value in the appsetting like this,
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
If you set an unobtrusiveValidation mode to none(default), the asp.net application will use the pre 4.5 behavior for client side validation. If you set the key value to web forms, the application will use the HTML5 attributes for client side validation.