加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – ScriptManagers的ScriptMode中Debug和Release有什么

发布时间:2020-12-16 07:03:40 所属栏目:asp.Net 来源:网络整理
导读:在ASP.NET AJAX中,我可以为ScriptManager设置ScriptMode. 脚本模式可以是Debug或Release. 它们之间有什么确切的区别?是否真的在调试模式下,生成的脚本不会在浏览器上缓存,而在发布模式下,它们将被缓存,并且后续的服务器访问将被阻止? 解决方法 参考 Script
在ASP.NET AJAX中,我可以为ScriptManager设置ScriptMode.
脚本模式可以是Debug或Release.
它们之间有什么确切的区别?是否真的在调试模式下,生成的脚本不会在浏览器上缓存,而在发布模式下,它们将被缓存,并且后续的服务器访问将被阻止?

解决方法

参考 ScriptManager.ScriptMode Property:

In Debug mode,debug versions of
client script libraries are used in
the Web page unless the retail
attribute of the deployment
configuration element is set to true.

In Release mode,release versions of
client script libraries are used in
the Web page unless the retail
attribute of the deployment
configuration element is set to false.

参见Debugging and Tracing Ajax Applications Overview:

The Microsoft Ajax architecture provides a model for release and debug modes. Release mode provides error checking and exception handling that is optimized for performance,with minimized script size. Debug mode provides more robust debugging features,such as type and argument checking. If you create debug versions of client script files or script resources,ASP.NET runs the debug versions when the application is in debug mode. This enables you to throw exceptions in debug scripts but still keep the size of release code to a minimum.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读