简体   繁体   English

ScriptManager由ToolkitScriptManager修复

[英]ScriptManager fixed by ToolkitScriptManager

I know that in order to use most of the controls from the Ajax Control Toolkit, you need to include the ToolkitScriptManager control on your page, and it must be the Toolkit script manager, and not the standard script manager because the extended toolkit version contains extra (java)scripts which enable the controls to work and communicate properly. 我知道,为了使用Ajax控件工具包中的大多数控件,您需要在页面上包括ToolkitScriptManager控件,并且它必须是Toolkit脚本管理器,而不是标准脚本管理器,因为扩展的工具箱版本包含其他功能。 (java)脚本,使控件能够正常工作和通信。

My problem is that I keep coming across projects at work from other developers where they used the standard ASP ScriptManager control, and added toolkit controls without switching over to the ToolkitScriptManager. 我的问题是,我不断遇到来自其他开发人员的项目,他们使用标准的ASP ScriptManager控件,并在不切换到ToolkitScriptManager的情况下添加了工具包控件。 I would have expected these projects to not debug properly, yet they are currently somehow working in test and production environments, and they do not actually break until I download them onto my freshly loaded dev environment from source control. 我原本希望这些项目无法正确调试,但是它们目前在某种程度上可以在测试和生产环境中工作,并且直到我从源代码管理将它们下载到新加载的开发环境中之后,它们才真正崩溃。

When someone asked me "Why do we need to replace these controls? They're working everywhere else." 当有人问我“为什么我们需要更换这些控件?它们在其他地方都起作用”。 I could only shrug my shoulders, I have no idea why other projects are working with regular script managers. 我只能耸耸肩膀,不知道为什么其他项目正在与常规脚本管理器一起工作。

As a side note, problems like this are what are pushing me into becoming a JQuery guy instead of a ACT guy. 附带说明一下,像这样的问题促使我成为一名JQuery而不是ACT。

Here is a question to answer since this is a Q&A site and not a discussion site: " How is it possible to run the ACT controls without an ACT script manager? " Personally, I would point to a glitch in Visual Studio of some kind, but I want to know if anyone else knows more. 这是一个要回答的问题,因为这是一个问答站点,而不是讨论站点:“ 如果没有ACT脚本管理器,怎么可能运行ACT控件? ”就我个人而言,我会指出某种形式的Visual Studio故障,但我想知道是否还有其他人知道更多。

ToolkitScriptManager inherits from ScriptManager and extends/improves its functionality. ToolkitScriptManager继承自ScriptManager,并扩展/改进了其功能。

You may safely substitute ToolkitScriptManager with ScriptManager just so long as you are not using any advanced feature provided by the ToolkitScriptManager. 只要不使用ToolkitScriptManager提供的任何高级功能,就可以用ScriptManager安全地替换ToolkitScriptManager。

What are those supposedly advanced feature differences you ask? 您问那些所谓的高级功能差异是什么?

Check Here for your answer... 在这里查看您的答案...

TMI Alert: MS actually recommends replacing ToolkitScriptManager in certain instances if you are suffering from Out Of Memory exceptions and there are also a high number of System.Web.FileMonitorTarget objects in existence. TMI警告:在某些情况下,如果您遇到内存不足异常并且还存在大量System.Web.FileMonitorTarget对象,MS实际上建议在某些情况下替换ToolkitScriptManager。 These objects are used to check and see if the page was modified (you can see how it relates to AJAX), but these objects should go away and not be maintained. 这些对象用于检查并查看页面是否被修改(您可以看到它与AJAX的关系),但是这些对象应该消失而不应维护。

For some reason, if you're using the ToolkitScriptManager, there are instances where FileMonitorTarget objects just don't go away and end up contributing to server memory problems, but neither I nor they fully understand why replacing the ToolkitScriptManager with ScriptManager actually helps in these scenarios, but just so long as it works, we won't continue to ask questions... 出于某种原因,如果您使用的是ToolkitScriptManager,则在某些情况下FileMonitorTarget对象不会消失并最终导致服务器内存问题,但是我和他们都没有完全理解为什么用ScriptManager替换ToolkitScriptManager实际上会在这些方面有所帮助场景,但只要可行,我们就不会继续提出问题...

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

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