#Taken from the upgrade notes for v15.1:
> Note: if you use named Control Bundles (defined in the ~/AjaxControlToolkit.config file), then adjust the script bundle virtual path as shown below:
```
"~/Scripts/AjaxControlToolkit/<ControlBundleName>Bundle".
```
When I try to use named bundles, I get lots of js errors due to the scripts having been loaded twice, once from the named bundle path and again as individual script requests (although it does appear that only the scripts required by the listed controls are being requested).
My named bundle in ajaxcontroltoolkit.config:
```
<?xml version="1.0"?>
<ajaxControlToolkit>
<controlBundles>
<controlBundle name="MyControls">
<control name="ModalPopupExtender" />
<control name="TextBoxWatermarkExtender" />
<control name="ValidatorCalloutExtender" />
<control name="RatingExtender" />
</controlBundle>
</controlBundles>
</ajaxControlToolkit>
```
For this combination of controls, with the following in the Scripts section of the ScripManager:
```
<asp:ScriptReference Path="~/Scripts/AjaxControlToolkit/MyControlsBundle" />
```
Which renders the following to the page:
```
<script src="/Scripts/AjaxControlToolkit/MyControlsBundle?v=O3ddV2GUABJyHyjuUxaVBNm_B_CImi6mx5n1B_iSi-c1" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/ComponentSet.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Common.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/BaseScripts.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/TextBoxWatermark.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Compat.Timer.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/AnimationScripts.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Animation.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Popup.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/ValidatorCallout.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/RoundedCorners.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/DropShadow.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Compat.DragDrop.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/FloatingBehavior.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/DynamicPopulate.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/ModalPopup.js" type="text/javascript"></script>
```
/Scripts/AjaxControlToolkit/MyControlsBundle?v={hash} returns a 195kb file.
Note: The above is using CDN settings, but I get the same problem whether the scripts are loaded from CDN or local server:
It happens in any combination of the following settings:
BundleTable.Bundles.UseCdn = true/false
ScriptManager.EnableCdn = true false
BundleTable.EnableOptimizations = true/false
compilation debug = true/false
If I remove the specific bundle naming it should fall back to the default (un-named) control bundle, which it appears to do (bundle file is still 195kb if served locally, 295kb from CDN presumably because it serves up the full suite of controls and not the restricted set), but, I really wanted to use different named bundles for different parts of my site.
Comments: Thank you for your report! We'll investigate the issue. To overcome this problem, add a Default (unnamed) bundle to your AjaxControlToolkit.config containing all the AJAX Control Toolkit controls your project uses: <controlBundle> <control name="ModalPopupExtender" /> <control name="TextBoxWatermarkExtender" /> <control name="ValidatorCalloutExtender" /> <control name="RatingExtender" /> .... </controlBundle>
> Note: if you use named Control Bundles (defined in the ~/AjaxControlToolkit.config file), then adjust the script bundle virtual path as shown below:
```
"~/Scripts/AjaxControlToolkit/<ControlBundleName>Bundle".
```
When I try to use named bundles, I get lots of js errors due to the scripts having been loaded twice, once from the named bundle path and again as individual script requests (although it does appear that only the scripts required by the listed controls are being requested).
My named bundle in ajaxcontroltoolkit.config:
```
<?xml version="1.0"?>
<ajaxControlToolkit>
<controlBundles>
<controlBundle name="MyControls">
<control name="ModalPopupExtender" />
<control name="TextBoxWatermarkExtender" />
<control name="ValidatorCalloutExtender" />
<control name="RatingExtender" />
</controlBundle>
</controlBundles>
</ajaxControlToolkit>
```
For this combination of controls, with the following in the Scripts section of the ScripManager:
```
<asp:ScriptReference Path="~/Scripts/AjaxControlToolkit/MyControlsBundle" />
```
Which renders the following to the page:
```
<script src="/Scripts/AjaxControlToolkit/MyControlsBundle?v=O3ddV2GUABJyHyjuUxaVBNm_B_CImi6mx5n1B_iSi-c1" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/ComponentSet.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Common.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/BaseScripts.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/TextBoxWatermark.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Compat.Timer.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/AnimationScripts.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Animation.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Popup.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/ValidatorCallout.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/RoundedCorners.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/DropShadow.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/Compat.DragDrop.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/FloatingBehavior.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/DynamicPopulate.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/act/15.1.1/Scripts/AjaxControlToolkit/Release/ModalPopup.js" type="text/javascript"></script>
```
/Scripts/AjaxControlToolkit/MyControlsBundle?v={hash} returns a 195kb file.
Note: The above is using CDN settings, but I get the same problem whether the scripts are loaded from CDN or local server:
It happens in any combination of the following settings:
BundleTable.Bundles.UseCdn = true/false
ScriptManager.EnableCdn = true false
BundleTable.EnableOptimizations = true/false
compilation debug = true/false
If I remove the specific bundle naming it should fall back to the default (un-named) control bundle, which it appears to do (bundle file is still 195kb if served locally, 295kb from CDN presumably because it serves up the full suite of controls and not the restricted set), but, I really wanted to use different named bundles for different parts of my site.
Comments: Thank you for your report! We'll investigate the issue. To overcome this problem, add a Default (unnamed) bundle to your AjaxControlToolkit.config containing all the AJAX Control Toolkit controls your project uses: <controlBundle> <control name="ModalPopupExtender" /> <control name="TextBoxWatermarkExtender" /> <control name="ValidatorCalloutExtender" /> <control name="RatingExtender" /> .... </controlBundle>