AJAX Control Toolkit Loading All Scripts

2019-05-15 19:09发布

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:

A selection of the scripts being loaded

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.

2条回答
不美不萌又怎样
2楼-- · 2019-05-15 19:33

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

查看更多
Anthone
3楼-- · 2019-05-15 19:51

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>
查看更多
登录 后发表回答