简体   繁体   English

防止加载MicrosoftAjaxWebForms.debug.js

[英]Preventing MicrosoftAjaxWebForms.debug.js from loading

I've got an ASP.NET web application, and I'm attempting to reduce HTTP calls to the server, so I'd like to not load things like MicrosoftAjaxWebForms.debug.js and MicrosoftAjax.debug.js . 我有一个ASP.NET Web应用程序,我正在尝试减少对服务器的HTTP调用,所以我不想加载像MicrosoftAjaxWebForms.debug.jsMicrosoftAjax.debug.js这样的东西。

Script manager is used to form all of my external javascript files into one, and I'm concerned that this is causing other non-related libraries to be loaded. 脚本管理器用于将我的所有外部javascript文件组合成一个,我担心这会导致其他非相关库被加载。

To get rid of the debug versions of the scripts you have to disable debug mode in web.config . 要摆脱脚本的调试版本,必须在web.config禁用调试模式。 Find the element called <compilation debug="true"> under /configuration/system.web and change it to <compilation debug="false"> . /configuration/system.web下找到名为<compilation debug="true"> /configuration/system.web ,并将其更改为<compilation debug="false">

It is indeed the ScriptManager that is pulling these in. You might be able to reduce the number of scripts it adds by turning off the different features on it, eg. 确实是ScriptManager正在将它们拉进去。你可以通过关闭它上面的不同功能来减少它添加的脚本数量,例如。 PageMethods . PageMethods
Look for the properties that starts with Enable... 查找以Enable...开头的属性

Of course, it will probably be easier to just create a small method that does the same as the ScriptManager, all it does is add some <script> tags to the document.. 当然,创建一个与ScriptManager相同的小方法可能会更容易,它只是在文档中添加一些<script>标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM