Using the AJAX Control Toolkit in DotNetNuke 

I find that web development projects are requiring more and more AJAX functionality. The bells and whistles that come with AJAX are hard things for many people to live without. One of the more common toolsets to use when working with AJAX items in the .NET environment is the ASP.NET AJAX Control Toolkit. I have found that with VERY minimal effort you can fully implement the toolkit inside a DNN installation and it can even be done WITHOUT modification to the web.config file. This blog entry will provide information on how to incorporate the ASP.NET AJAX Control Toolkit into your project. I will simply discuss the DNN implementation, I am NOT going to actually discuss the usage of any specific control.

Get the Package

Once you have obtained the Control Toolkit Files you will want to copy the AjaxControlToolkit.dll file to the bin directory of your DotNetNuke installation being used for development. This process is similar to that of implementation in a standard ASP.NET application.

Reference and Usage

To actually use the controls and build your modules you must add two references to your module. System.Web.Extensions.dll and the newly added AjaxControlToolkit.dll file. The good news is that the System.Web.Extensions.dll is ALREADY part of a DNN installation for all versions 4.6.0 and later. THe AjaxControlToolkit.dll is the new file and is the only thing that will eventually be deployed to your production environment.

Once the references have been added to your project, you can add the controls to your module(s) using the examples provided in the "Demo" of the Control Toolkit. ALl in all, obtaining the files, adding references, and working with the controls is the exact same when working on DNN modules.

Deploying to DNN

Deploying to DNN is very simple, you must simply add the AjaxControlToolkit.dll file to your .dnn file as an individual listing in the Files section and include it in the package. As it is installed the .dll will be loaded and all controls are functional. Overall the proces to include this into your project is just the same as including any other DLL file.

Design Considerations

The biggest complaint from users of the Ajax Control Toolkit with DNN is that you have multiple issues with CSS, styling, and positioning. It is very common for extenders to appear in dramatically incorrect locations. I have found that wrapping a module with a >div< tag and set its position to "relative" fixes about 99.9% of the design issues that come up with DotNetNuke and the controls.

Conclusion

Including the ASP.NET AJAX Control Tookit is a very easy process when working in DotNetNuke and doesn't result in any major modifications to a DNN site, nor does it require any "out of the ordinary" procedures from an administrative point of view. This makes it really easy for individuals to quickly add nice user interface additions, to provide interactive sites.

As always, please feel free to share you comments/feedback below. If you have specific questions please use the forums.

Posted by Mitchel on Saturday, September 13, 2008
 

Comments

The

tip does not do the job with third-party skins designed only for the default DOCTYPE.

By ChevNova on Sunday, November 09, 2008 at 4:20 PM

Mitchel : if you include the reference in a module manifest package, then you can get the problem where deleting the module removes the toolkit dll for other modules. Any thoughts?

By Bruce Chapman on Monday, May 25, 2009 at 12:48 AM

There are a couple of thoughts.

1.) Package and build only for DNN 5.x, as with the new manifest format, DNN manages cross-module references.

2.) Have the placement of the dll file be a manual user intervention step, this isn't a good solution, but sadly the most common that I have seen yet.

By mitchel.sellers@gmail.com on Monday, May 25, 2009 at 10:14 AM

Hi.
I want to change only the HTML Editor.
But I search, and I can do this by the web.config. But I can't do that.
How you sugest to do that?
Cheers, João Rosa

By João Rosa on Tuesday, May 26, 2009 at 7:02 PM

AjaxControlToolkit version 3.0.20820.0 works well with DNN 5.5.1. Just tested it on http://www.kontorshotellen.se But when upgrading the AjaxControlToolkit to version 3.5.40412.2 it stops working in DNN 5.5.1

To new it seems that there should be some adjustment inside the new AjaxControlToolkit version 3.5.40412.2 ... probably with the scriptmanager that is usually

By Johan Johansson on Thursday, October 07, 2010 at 1:23 PM

Hi guys i just installed the Ajax Control Tool Kit in my VS 2010 application, and now the dnn module that displays the control i created with a calender extender dpnt work anymore. Can you please advise on how i can resolve that issue???

By Simbarashe on Wednesday, October 27, 2010 at 9:30 AM

In the development machine, ajax control toolkit (Calendar Extender) is working fine.
When I am deploying this, its show some error like AjaxControlToolKit.dll could not find file. Even, I included the AjaxControlToolKit.dll file in the bin folder of my deployment server i am using power dnn server.

By Christy Rajan on Wednesday, November 03, 2010 at 7:35 AM

In the development machine, ajax control toolkit (Calendar Extender) is working fine.
When I am deploying this, its show some error like AjaxControlToolKit.dll could not find file. Even, I included the AjaxControlToolKit.dll file in the bin folder of my deployment server i am using power dnn server.

By Christy Rajan on Wednesday, November 03, 2010 at 7:35 AM

In addition to the problem mentioned by Bruce Chapman another problem that can occur is that another module will install a later version leaving your module unable to find the version it was compiled against. (Setting "specific version" to false in VS doesn't help.)

I did a forum post that seems to address the problem (http://forum.galleryserverpro.com/default.aspx?g=posts&m=5686) and it worked for me. In my case I had a module compiles against 1.0.20229.20821 and then installed a module that overwrote AjaxControlToolkit with version 3.0.30930.28736. So I added the following to the configuration/runtime/assemblyBinding node in web.config:





Mitchel, does DNN's management of cross-module references deal with this? Has there been any discussion, that you know of, for DNN to track the versions and add any necessary bindingRedirect's to the web config? Of course, maybe that's a bad idea anyway.

By Paul Bolejack on Tuesday, April 05, 2011 at 1:50 PM

DNN's management of assemblies ONLY goes as far as making sure that files are not accidentally deleted

By mitchel.sellers@gmail.com on Tuesday, April 05, 2011 at 2:05 PM

hello mitchel
ok there was ajaxcontroltoolkit version 3.0 in the bin folder of my dnn.but when i installed another module with ajaxcontroltoolkit version 3.5 the previous version 3.0 is deleted.is there any way i can keep two versions needed for two modules??

By mks on Tuesday, May 10, 2011 at 7:29 AM

mks,

You can only have one version of any DLL at any time in the bin directory.

By mitchel.sellers@gmail.com on Tuesday, May 10, 2011 at 8:30 AM

Mitch, I can't get ajax control toolkit to work on my development machine. I went ahead and upgraded to 6.0.1. The assemblies in the dependent assembly section of the web.config upgraded to 4.0.0.0 but the assemblies for system.web.extensions remained 3.5.0.0 causing a conflict with the ajax extensions. Changing these assembly references to 4.0.0.0 causes Admin.ControlPanel.AddModule.acsx to fail (probably just the first that the debugger hit). I don't know which assembly references to selectively change. The reinstall DID NOT automatically fix the problem.

By Dana Armstrong on Friday, September 02, 2011 at 11:53 AM

Don't know much about how this stuff works, but after a lot of trial and error, changing the compiler version value to v4.0 for vb and c#, as well as all of the system.web.extension versions to 4.0.0.0 and adding the line to web.config at least the website will build.

By Dana Armstrong on Friday, September 02, 2011 at 8:05 PM

I follow your this post. and i did according to you. I check my install and source files after build the project ajaxcontrolkit.dll files is there in bin folder. but when i browse my module in browser its not shows the ajax calender i did not know what i have to do now. please help me out.

By Shahid Majeed on Thursday, November 10, 2011 at 7:10 PM

Name (required)

Email (required)

Website

CAPTCHA image
Enter the code shown above:

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Friend of RedGate

www.datasprings.com - DotNetNuke ModulesICG

Click here for advertising information.

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.