脚本管理器和工具脚本管理器之间的差异 [英] Difference between script manager and toolkit script manager

查看:107
本文介绍了脚本管理器和工具脚本管理器之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是的ScriptManager之间的差异 ToolkitScriptManager ?我只找到一个令人信服的理由:该 ToolkitScriptManager 提高页面性能。如果是这样,为什么使用的ScriptManager

What are the differences between ScriptManager and ToolkitScriptManager? I found only one convincing reason: that ToolkitScriptManager improves page performance. If so why use ScriptManager?

推荐答案

首先:如果你使用ASP.NET 3.5和控件AJAX控件的无线工具包,那么你必须使用ToolkitScriptManager,而不是ASP.NET的ScriptManager。根据这一事实,即工具箱脚本管理器会将更新的Ajax脚本,并没有大多数来自AJAX控件工具包库中的控件将无法正常工作此限制。

First of all: if you use ASP.NET 3.5 and controls from AJAX Control Tookit then you must use the ToolkitScriptManager, rather than the ASP.NET ScriptManager. This limitation according to the fact that toolkit script manager adds updated Ajax scripts and without that most of the controls from Ajax Control toolkit library will not work.

如果您在使用ASP.NET 4.0(4.5),比你有选择使用的ScriptManager或ToolkitScriptManager。

If you using ASP.NET 4.0 (4.5) than you have choice to use ScriptManager or ToolkitScriptManager.

基本上ToolkitScriptManager的主要特点是,它可以结合使用的ScriptReference集合的js资源添加到页面。这些js文件应该嵌入到组装和应加本届大会ScriptCombine集属性。这里的主要问题是,你无法控制脚本如何组合之后,你会尝试自己的脚本结合起来,你可以有很多问题(我有​​经验,使用此功能,因此我们使用否决结合我们的脚本这种做法)。

Basically the main feature of the ToolkitScriptManager is that it can combine js resource added to page using ScriptReference collection. These js files should be embedded to assembly and for this Assembly ScriptCombine assembly attribute should be added. The main problem here is that you can't control how scripts are combined and after you will try to combine your own scripts you can have a lot of problems (I had experience using this feature and as a result we rejected combining of our scripts using this approach).

这里主要的一点是,目前标准的脚本经理必须采用复合脚本收集脚本相结合的能力。此功能更灵活,更容易控制脚本是如何结合您的网页上。的详细信息可以用下面的链接中找到:<一href=\"http://weblogs.asp.net/infinitiesloop/archive/2009/11/23/asp-net-4-0-scriptmanager-improvements.aspx\">http://weblogs.asp.net/infinitiesloop/archive/2009/11/23/asp-net-4-0-scriptmanager-improvements.aspx.

The main point here is that currently standard script manager has ability to combine scripts using composite script collection. This feature is more flexible and it is more easy to control how scripts are combined on your pages. The more information can be found using the following link: http://weblogs.asp.net/infinitiesloop/archive/2009/11/23/asp-net-4-0-scriptmanager-improvements.aspx.

另外请注意,据我记住,如果你使用ToolkitScriptManager,那么你将无法使用CompositeScript功能,甚至采取帐户的ToolkitScriptManager从ScriptManager的派生的。

Also, note that as far as I remember if you using ToolkitScriptManager then you will not be able to use CompositeScript feature, even to take in account that the ToolkitScriptManager derives from ScriptManager.

所以,在ASP.NET 4.0中的差别不是那么大,而且最好是避免使用ToolkitScriptManager。主要的原因在于,使用标准CompositeScript特征您对脚本如何组合,并且可以优化网页的呈现的控制。

So, in ASP.NET 4.0 the difference is not so big, and it is better to avoid using ToolkitScriptManager. The main reason is that using standard CompositeScript feature you have more control on how scripts are combined and can optimized rendering of the page.

有关ASP.NET 3.5,如果你想使用的控制从阿贾克斯控制工具包库你没有选择。

For ASP.NET 3.5 you don't have choice if you want to use controls from Ajax Control Toolkit library.

修改

随着AJAX控件工具包库,他们继续更新MS的Ajax脚本,这就是为什么一些控制离不开增加ToolkitScriptManager工作的最新变化。

With the latest changes in ajax control toolkit library they proceed to update MS Ajax scripts and that's why some of the controls can't work without adding ToolkitScriptManager.

这篇关于脚本管理器和工具脚本管理器之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆