[RESOLVED]Error regarding "Jquery"

Good morning, I am new to ASP.net and I am trying to create a sign up page. However I keep getting the following message, what does it mean? what should I do?

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() +2191002
   System.Web.UI.WebControls.BaseValidator.RegisterUnobtrusiveScript() +10
   System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +9845329
   System.Web.UI.Control.PreRenderRecursiveInternal() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974

Hi,

and welcome to the ASP.NET forums.

It means you’re likely missing some parts of code:

In the global.asax:

ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();
myScriptResDef.Path = "~/Scripts/jquery-1.4.2.min.js";
myScriptResDef.DebugPath = "~/Scripts/jquery-1.4.2.js";
myScriptResDef.CdnPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);

In the master page:

<asp:ScriptManager ID="sm1" runat="server">
  <Scripts>
    <asp:ScriptReference Name="jquery"/>
  </Scripts>
</asp:ScriptManager>

It could be that you need to alter these according to your project. For more information take a look at

http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.scriptresourcemapping(v=vs.110).aspx.

Grz, Kris.

can you please verify that following web.config key/setting is there in your web config file? or you can get the further possible fixes from the link below. thanks 

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

http://stackoverflow.com/questions/16660900/webforms-unobtrusivevalidationmode-requires-a-scriptresourcemapping-for-jquery

Leave a Reply