AJAX Control Toolkit Loading All Scripts

一世执手 提交于 2020-01-02 07:31:28

问题


I have a bit of a weird problem I can't seem to fix. I am using the AJAX Control Toolkit's calendar extender on some of my pages. Despite the information I've found via the web I can't seem to get it working with a regular ScriptManager control, it only works with a ToolkitScriptManager. However I've noticed that when the page loads it adds some 84 script files for every possible control script provided by the toolkit:

Is this the expected behaviour, and can I turn it off? I only need it to load the relevant scripts to handle the calendar extender.


回答1:


In current version of ACT you can group extenders in bundle and specify which bundles you need to include. Add AjaxControlToolkit.config file to project like here Codeplex AjaxControlToolkit.config, add new controlBundle entry to this file for CalendarExtender like this:

<controlBundle name="Calendar">
  <control name="CalendarExtender"></control>
</controlBundle>

and specify this bundle in ToolkitScriptmanager control:

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



回答2:


Use ControlBundles to solve this, follow this step about ControlBundles on how to do it.



来源:https://stackoverflow.com/questions/18971547/ajax-control-toolkit-loading-all-scripts

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