AJAX and the DotNetNuke Repository
After upgrading my sites to DotNetNuke version 4.5.0 I have decided to start experimenting with the new AJAX support built into the DotNetNuke core. I thought the one of the best ways I could start would be to look into the various core modules that I use on a daily basis and see which of them could successfully handle enabling AJAX and still render appropriate page content. This blog entry provides the detail on my first module modification, the DNN Repository.
Disclaimer:
Given the nature of the AJAX support and requirements for successful implmentation you should test the below items on a safe environment prior to actually updating any working production sites as it is possible that even though this worked in my setup that it might not work for you. Therefore, I offer no guarantees that these steps will work for you, however, I can tell you that I have tested them on 5 different DNN installations and they are all working fine for me.
Summary of Changes:
To actually enable AJAX is very simple give tne new features of DNN. You can enable AJAX on an individual user control within a specific module from within the module definitions page. What exactly does enabling AJAX do for the module if it is enabled? Well when you have AJAX enabled for a specific control DotNetNuke will automatically wrap the entire module within an UpdatePanel control which will allow the module to use AJAX for postbacks. This is all accomplished by setting the "Supports Partial Rendering?" option under the module control definition. Below I will provide details on how to enable AJAX on the Repository Module.
Making the Changes:
To make the needed changes you must be logged into the site with the host account, then follow the below instructions.
- From the "Host" menu select "Module Definitions"
- Click the "Edit" link to the left of the "Repository" module
- Scroll to the Control definitions and select "Edit" for the "Repository.aspx" control
- On this settings page check the box for "Supports Partial Rendering?"
- Click "Update" to save the settings
- (Optional) You can set the "Dependencies:" setting for the module by adding "System.Web.UI.ScriptManager" (without quotes), however in my testing this was NOT necessary if modifying an existing module
- You should now notice when clicking the "Comments", "Rating", and other selection items within the repository that only that module is updated and not the entire page.
Summary:
This was a very quick and simple tutorial on my first attempts at enabling AJAX on DotNetNuke core modules, there will be more to come in the near future. If you plan on making this change to your own site PLEASE be sure to test this prior to implementation. To see a demonstration of this in action please visit this page http://freedotnetnukestuff.com/FreeModulesSkins/tabid/177/Default.aspx
EDIT 5/31/2007 - Issues have been identified with this method that do not make it practical in all circumstances!
Posted by Mitchel on Monday, April 16, 2007
Click here to post a comment