Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
I am developing a project with ASP.net c# in Visual Studio 2012. I am adding a validator, and it works perfectly fine in Visual Studio 2010. but in Visual Studio 2012 I am receiving the Error:
Server Error in '/' Application.

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive). 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InvalidOperationException: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[InvalidOperationException: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).]
   System.Web.UI.ClientScriptManager.EnsureJqueryRegistered() +2170338
   System.Web.UI.WebControls.BaseValidator.RegisterUnobtrusiveScript() +10
   System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +9575857
   System.Web.UI.Control.PreRenderRecursiveInternal() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974

Please Help Me.
Posted
Updated 25-Nov-18 21:55pm

 
Share this answer
 
ya i have a same issue..


you just right click to add new items-->global application class for global.asax.
then add the class given below..


HTML
void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();
        myScriptResDef.Path = "~/scripts/jquery-1.8.1.js";
        myScriptResDef.DebugPath = "~/scripts/jquery-1.8.1.js";
        myScriptResDef.CdnPath = "http://code.jquery.com/jquery-1.8.1.js";
        myScriptResDef.CdnDebugPath = "http://code.jquery.com/jquery-1.8.1.js";
        ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);

    }




then start debug.
its will surely work..
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900