Advertisements

Archive

Posts Tagged ‘UnobtrusiveValidationMode’

Error: WebForms UnobtrusiveValidationMode Requires a ScriptResourceMapping For jQuery in .Net

December 18, 2017 Leave a comment

Getting below error after using RequiredFieldValidator for textbox

Error: WebForms UnobtrusiveValidationMode Requires a ScriptResourceMapping For jQuery in .Net

In this post I am trying to explain solution for the above error.

Sample Code :

<asp:TextBox ID=”txtName” runat=”server”></asp:TextBox>
<asp:RequiredFieldValidator ID=”reqName” runat=”server” Display=”Dynamic” ControlToValidate=”txtName”  Text=”*” Style=”color: red”></asp:RequiredFieldValidator>
<asp:Button ID=”btnSubmit” Text=”Submit” runat=”server” OnClick=”btnSubmit_Click” />

Solution

Now add key for Unobtrusive under web.config file <appSettings> tag as following code.

 

<configuration>
<system.web>
<compilation debug=”true” targetFramework=”4.5″ />
<httpRuntime targetFramework=”4.5″ />
</system.web>
<appSettings>
    <add key=”ValidationSettings:UnobtrusiveValidationMode” value=”None” />
</appSettings>
</configuration>

 

 

Advertisements