tags:

views:

29

answers:

2

can we use AJAXToolKit and Jquery in the same page?

Say i have ScriptManage in that same page and i have also included the

+2  A: 

The jQuery library, and virtually all of its plugins are constrained within the jQuery namespace. As a general rule, "global" objects are stored inside the jQuery namespace as well, so you shouldn't get a clash between jQuery and any other library (like Prototype, MooTools, or YUI).

That said, there is one caveat: By default, jQuery uses "$" as a shortcut for "jQuery"

However, you can override that default by calling jQuery.noConflict() at any point after jQuery and the other library have both loaded. For example:

   <script>
     jQuery.noConflict();

     // Use jQuery via jQuery(...)
     jQuery(document).ready(function(){
       jQuery("div").hide();
     });

     // Use Prototype with $(...), etc.
     $('someid').hide();
   </script>

this way Query won't conflict with another library

Fayaz Mammoo
+3  A: 

Yes you can. However, you may want to make use of jQuery's noConflict() statement.

I recommend putting your jQuery script directive in the ScriptManager, and use AJAXToolkit's ToolkitScriptManager, in place of ScriptManager.

Wrapping your <Scripts> in a <CompositeScript> tag, in conjunction with AJAXToolkit's ToolkitScriptManager, will combine all script files into 1 download at runtime.

Jordan S. Jones