The Ajax Control Toolkit and jQuery play nicely together. In fact, some of the Ajax Control
Toolkit controls — such as the ToggleButton and Tabs controls — were written using jQuery.
This page describes how you can use the Ajax Control Toolkit with a website that is already using jQuery.
Including a jQuery Script Reference in the ToolkitScriptManager
jQuery Ajax Control Toolkit version (actJQuery):
jQuery dollar sign ($) version:
The Ajax Control Toolkit uses a particular version of jQuery. Currently, the Ajax Control
Toolkit uses jQuery version .
You can use another version of jQuery in the same page as the Ajax Control
Toolkit without creating a conflict. The Ajax Control Toolkit uses the jQuery.noConflict() method
to prevent conflicts with other versions of jQuery in the same page. The version of jQuery
used by the Ajax Control Toolkit is assigned to a variable named actJQuery.
For example, in the code above, the ToolkitScriptManager is used to add a reference to
jQuery version 2.0.3 from the Microsoft Ajax CDN. You can use this version of jQuery
in the page by using the standard jQuery $ variable or the standard jQuery variable.
Because the Ajax Control Toolkit uses actJQuery and not $, the Ajax Control Toolkit does not
conflict with existing versions of jQuery used in a website.
Preventing jQuery from Loading Twice
So by default, the Ajax Control Toolkit will not conflict with any existing version of jQuery used in your application. However, this does
mean that if you are already using jQuery in your application then jQuery will be loaded twice. For performance reasons, you might want
to avoid loading the jQuery library twice.
By taking advantage of the <remove> element in the AjaxControlToolkit.config file, you can prevent the Ajax Control Toolkit from
loading its version of jQuery.
(Be careful here, the name of the script is case-sensitive)
If you remove jQuery then it is your responsibility to add the exact same version of jQuery back into your application
by using either the ToolkitScriptManager or adding a <script> tag that loads jQuery. Also, if you use a
<script> tag then you need to be careful to add jQuery before the opening server-side <form> tag.
The Ajax Control Toolkit is tested against the particular version of jQuery that is bundled with the Ajax Control Toolkit.
Currently, the Ajax Control Toolkit uses jQuery version . If you attempt
to use a different version of jQuery with the Ajax Control Toolkit then we will throw an exception at you.