I am developing DNN modules and I am using jQuery in some modules, I add the jQuery reference to the top of each ascx file, by the way when user add multiple modules to the
If you're on DNN 5.x, you should be using the DNN core's version of jQuery, by calling DotNetNuke.Framework.jQuery.RequestRegistration()
.
If you're only dealing with conflict within your own modules, you can add the script in code and then check if it's already been added. We add jQuery manually into the header (create a generic HTML control, and add it to Page.Header.Controls
), then call Page.ClientScript.RegisterClientScriptBlock()
to create a script block to call jQuery.noConflict (so that it doesn't interfere with DNN's JavaScript stuff). You can then wrap the whole call to add jQuery in a call to Page.ClientScript.IsClientScriptBlockRegistered()
, so that it only gets added once.