Ajax Control Toolkit is loading too many script resources

為{幸葍}努か 提交于 2019-11-30 09:04:37

CodePlex's AjaxControlToolkit release of July 2013 introducing control bundles.

After this by default AjaxControlToolkit loads all scripts. So, to manage what scripts for what controls should be added and grouped you need to add AjaxControlToolkit.config to root of your web application project. Like in the following example:

<ajaxControlToolkit>
  <controlBundles>
    <controlBundle>
      <control name="CalendarExtender" />
      <control name="ComboBox" />
        </controlBundle>
    <controlBundle name="CalendarBundle">
      <control name="CalendarExtender"></control>
    </controlBundle>
  </controlBundles>
</ajaxControlToolkit>

Then you will need to specify which bundels are going to be used on which page (or master page if you have controls which are used on all pages) by adding bundle with specific name to toolkit script manager control:

<ajaxToolkit:ToolkitScriptManager runat="server" CombineScripts="true" 
  ScriptMode="Release" >
  <ControlBundles>
       <ajaxToolkit:ControlBundle Name="Calendar" />
  </ControlBundles>
</ajaxToolkit:ToolkitScriptManager>

Remarks: here you can find example of the config which contains most (maybe all definition of the controls from ajax control toolkit library).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!