Click here to Skip to main content
11,806,026 members (63,123 online)
Click here to Skip to main content

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jQuery

, 28 Nov 2012 CPOL 360.9K 12
Rate this:
Please Sign up or sign in to vote.
A solution to the problem.

Today while working on an ASP.NET web application in VS Express 2012 for Web, I got a strange error like this.

Error : WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for ‘jquery’. Please add a ScriptResourceMapping named jquery(case-sensitive).

Error : WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for ‘jquery’. Please add a ScriptResourceMapping named jquery (case-sensitive).

It was strange because I just added some basic components like TextBox, RequiredfieldValidator, and validation summary controls only. Later I found a Microsoft Connect issue. And according to the Connect website, we can fix this by removing the following element from the web.config file.

<add key="ValidationSettings:UnobtrusiveValidationMode" 
value="WebForms" />

But I couldn’t find this element in my web.config file. Another option to fix this issue is registering jQuery in Global.asax in the Application_Start event like this:

    new ScriptResourceDefinition
Path = "~/scripts/jquery-1.7.2.min.js",
DebugPath = "~/scripts/jquery-1.7.2.min.js",
CdnPath = "",
CdnDebugPath = ""

And it worked without any issue. Adding the following element in web.config also works.

<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />

You can find more about Unobtrusive JavaScript on Wikipedia.

Happy programming


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Anuraj Parameswaran
Technical Lead
India India
Working as Tech. Lead

My blog :
You can follow me in twitter : @anuraj

You may also be interested in...

Comments and Discussions

QuestionReolved differently Pin
Gaurang Naik20-Nov-12 22:16
memberGaurang Naik20-Nov-12 22:16 
AnswerRe: Reolved differently Pin
Vijay Kanda27-Nov-12 21:15
memberVijay Kanda27-Nov-12 21:15 
AnswerRe: Reolved differently Pin
Anuraj Parameswaran27-Nov-12 21:53
memberAnuraj Parameswaran27-Nov-12 21:53 
GeneralRe: Reolved differently Pin
praleesha5-Apr-13 5:43
memberpraleesha5-Apr-13 5:43 
AnswerRe: Reolved differently Pin
The Stonx21-Mar-13 9:47
memberThe Stonx21-Mar-13 9:47 
AnswerRe: Reolved differently Pin
osmanrahimi26-Nov-14 2:36
professionalosmanrahimi26-Nov-14 2:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151002.1 | Last Updated 28 Nov 2012
Article Copyright 2012 by Anuraj Parameswaran
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid