locked
Help with "WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive)." error RRS feed

  • Question

  • User-2145974911 posted

    I just upgraded to .Net 4.5 RC and how I get this error:

    WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

     

    I though I disabled it in my web.config but maybe I did not. How can I stop this error?

    <?xml version="1.0"?>
    <configuration>
    
      <appSettings>
        <add key="aspnet:uselegacysynchronizationcontext" value="false" />
        <add key="ValidationSettings:UnobtrusiveValidationMode" value="WebForms" />
      </appSettings>
    
        <system.web>
          <authorization>
            <deny roles="Fan" />
            <deny users="?" />
          </authorization>
        </system.web>
    
        <location path="elmah.axd">
            <system.webServer>
                <handlers>
                    <add name="ELMAH"
                         verb="POST,GET,HEAD"
                         path="elmah.axd"
                         type="Elmah.ErrorLogPageFactory, Elmah"
                         preCondition="integratedMode" />
                </handlers>
            </system.webServer>
        </location>
        
    </configuration>

    Thursday, June 28, 2012 11:41 AM

Answers

All replies

  • User-2145974911 posted

    If you look at that post and my posted web.config you can see thye say to add

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

    to the web.config which I have.

     

    Also that is about VS 11 and 4.5 Beta, which I do not have the problems on. it was when I upgraded from 4.5 beta to rc

    Thursday, June 28, 2012 11:51 AM
  • User-2145974911 posted

    Ok i am stupid, I miss read it they said to REMOVE the the line of code. I removed it like I was supposed to and things work

    Thursday, June 28, 2012 1:54 PM
  • User1254222884 posted

    OK. What am I missing here?  I put in the path to jquery in the global.asax file and microsoft seems to be willy-nilly adding references to jquery to the html output and WIPING OUT my ALREADY INCLUDED references to jquery (meaning calls to those objects no longer work).  What do I have to do to say I've already included jQuery?  ????

    Friday, April 12, 2013 2:20 PM
  • User623467121 posted

    OK. What am I missing here?  I put in the path to jquery in the global.asax file and microsoft seems to be willy-nilly adding references to jquery to the html output and WIPING OUT my ALREADY INCLUDED references to jquery (meaning calls to those objects no longer work).  What do I have to do to say I've already included jQuery?  ????



    Hi ojm37, I experienced similar issue for my website project - added ScriptResourceMapping into Global.asax and even manually added jquery reference to my aspx pages, but managed to resolved by adding the below into my web.config:

     

    <configuration>
    
      <!--other sections -->
    
      <appSettings>
        <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
      </appSettings>
    
      <!--other sections -->
    
    </configuration>

    Hope this helps.

    Tuesday, April 16, 2013 10:58 PM
  • User1254222884 posted

    Doesn't that "turn off" validation?

    Wednesday, April 17, 2013 11:23 AM
  • User1254222884 posted

    Not really a SOLUTION to the issue, but it does have a workaround and gave me an idea for what also works: in global.asax, point to an EMPTY javascript file for the Microsoft include.  That way, my original jQuery include is preserved!

    Wednesday, April 17, 2013 11:25 AM
  • User-955115217 posted

    I just faced similar issue.. but resolved after first adding

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

    and then removing it.. I just dont know how it happened but my application runs fine now.. and yes my jquery was already there in the project.

    Friday, September 27, 2013 5:48 AM
  • User-427974212 posted

    Thank you so much it really helped me..... but what about they are saying also we can add some global.asax file in somewhat different way in previous coments you can see What is that actually... i m getting confused..can u please help me to understand this..

    You can check it in this link...

    http://connect.microsoft.com/VisualStudio/feedback/details/735928/in-asp-net-web-application-visual-basic-the-requiredfieldvalidator-doest-work

    Monday, October 21, 2013 1:14 PM