old jquery version is automatically included in asp.net webforms

前端 未结 2 1606
刺人心
刺人心 2021-01-19 10:14

I have a asp.net c# webforms project. In the output html in the div \"aspNetHidden\" is a link to



        
相关标签:
2条回答
  • 2021-01-19 10:53

    I found a solution. It's added by the scriptmanager, but can be overridden by adding the following in the global.asax. I don't know if I can disable it completely, but this works for me.

    string str = "1.10.2";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition
            {
                Path = "~/js/jquery-" + str + ".min.js",
                DebugPath = "~/js/jquery-" + str + ".min.js",
                CdnPath = "http://code.jquery.com/jquery-" + str + ".min.js",
                CdnDebugPath = "http://code.jquery.com/jquery-" + str + ".min.js",
                CdnSupportsSecureConnection = true
            });
    
    0 讨论(0)
  • 2021-01-19 10:53

    I solve my problem by change version of jquery in packages.config

    change

      <package id="AspNet.ScriptManager.jQuery" version="1.8.2" targetFramework="net45" />
     <package id="jQuery" version="1.8.2" targetFramework="net45" />
    

    to

    <package id="AspNet.ScriptManager.jQuery" version="2.1.4" targetFramework="net45" />
     <package id="jQuery" version="2.1.4" targetFramework="net45" />
    

    my jquery version is 2.1.4

    0 讨论(0)
提交回复
热议问题