This DNN module is available freely for download. You can either download the source
code or a Zip installation package to directly install it in DNN if you want to:
Download from our DNN Modules Page DISCLAIMER: This module was built and tested with DNN 4.5.1. This updated version of DNN makes DNN and Gaia much more compatible. 
Hello all, I am very excited to be writing my first blog post about Gaia. And what makes this even more exciting, is that it's about using Gaia Ajax Widgets to create a DotNetNuke chat module. And keeping with the DNN spirit, we will make this module available open source to all of you geeks out there ;)
We have been working closely with the DotNetNuke team to make sure that Gaia and DNN are 100% compatible. And so far they work great together :)
Building The DNN Ajax Chat Module
So let's dive in. First of all, we will be targeting DNN 4.5.1 with this module and we will create our module using VB.NET. It's probably a good idea now to open the solution
(Download From Here) and take a look around.
I started by creating a new Web Application Project (Gaia.DNN.Chat), then added a Class Library project to the solution to hold our referenced DLLs, this is probably a good idea to always have our referenced DLLs part of our solution.
As you can see I added the DotNetNuke.dll from DNN's 4.5.1 bin folder and also added Gaia.WebWidgets.dll (The Express Version) which you can download for free from
hereThe next step is to reference those DLLs from our Web App (Gaia.DNN.Chat) and also remove the Default.aspx file. We will now need to add a new Web User Control to our project (GaiaChat.ascx) get to code view and import a couple of namespaces:
- Gaia.WebWidgets
- DotNetNuke.Entities.Modules
I also added a module.css and a moduleimages folder that has some images used in our module.css, to make our module look a little nicer. Probably the first thing to do now is to flip to the VB code view of our User Control (GaiaChat.ascx) and inherit from PortalModuleBase.
We also need to modify our Control directive (in Source view), and set the Inherits property to "Gaia.DNN.Chat.GaiaChat", and while we are here, it's probably a good idea to add register directive to our Gaia Web Widgets.
view plaincopy to clipboardprint?
If you flip back to VB code view now, you will find that I also created a class that will encapsulate a "Chat", it has 3 properties, UserName, Content and Date and also overrides ToString() to format our chat the way we like.
Now, in the chat module we are using the ASP.NET Application object to store a generic List of Chats, but we can as well extend this module to create a "Chats" table in the DotNetNuke Database and use that table instead.
You can also see here that I created a ReadOnly property in our GaiaChat class that returns the generic List of Chats if it exists in the Application object or else it will create a new List of Chats, add it to the Application object and then return it.
Let's flip to the Design view of our User Control (GaiaChat.ascx). I am not going to explain in details what you can see here, because it's pretty self explanatory. But, here are few highlights. We have a Gaia Window, which is a top level window that we will simply show to the user by setting it's visible property to true from the startChatButton_Click event handler, this Gaia Window contains a Gaia Panel to display the chats, a Gaia TextBox to write the chats and a Gaia Button to submit the chats :)
You can also see here that we are using a Gaia Timer to pull the chats from the Application object every 5 seconds.
The code is also very straight forward, and as clean and compact as it can be. Thanks to Gaia ;)
Update: In response to your requests guys, now the chat module can be easily localized. If you download either the source or the installable zip file, you will see that we added some local resource files, for Norwegian (GaiaChat.ascx.nb-NO.resx), French (GaiaChat.ascx.fr-FR.resx), Spanish (GaiaChat.ascx.es-ES.resx) and German (GaiaChat.ascx.de-DE.resx). In addition to the default local resource file which is for English (GaiaChat.ascx.resx).
Now if you install this module, and set your DNN language settings appropriately, DNN should pick up the appropriate resource file automatically and use it. These resource files hold the Text for, the "Start Gaia Chat" Button, the Window Caption, and the "Submit" button. For the French, German and Spanish files, we just used Google Translation, so you might want to open them in Visual Studio or even Notepad and check if the translations are correct, And correct them if that's not the case.
Please, if you like this module help us by Digging, also tell us about any ideas you have for cool DNN modules to build with Gaia:
Gaia Forums