Advertisements
Home > ASP.NET > Error: WebForms UnobtrusiveValidationMode Requires a ScriptResourceMapping For jQuery in .Net

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


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
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: