old jquery version is automatically included in asp.net webforms

前端 未结 2 1630
刺人心
刺人心 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
            });
    

提交回复
热议问题