Earlier this year I started on a project to learn how to use SignalR, I had reasons to do so for my full time job (non-DNN related) but considering my DNN experience over the past 11 years I figured that learning how to use SignalR with DNN would be my fastest way to get myself up to speed. So I started working on a Chat module. Originally that module was called SignalRChat, and was available on codeplex, but ultimately I decided that name kind of sucked, so it needed to be something else.
In comes the DNN Chat module project, there was a Chat module for DNN long ago, but the last official release of it was in 2008, and while there was a Beta in 2010, it hadn't seen any development and work in years. So I approached DNNCorp about taking over the DNN Chat project and replacing it with my newly developed module, at the same time, going from "DNN Chat" to "dnnCHAT".
So here we are today, and the first official release of dnnCHAT is now available, v01.00.00, you can download it now from Codeplex.
You can see the module in action on http://www.dnnchat.com
Here are some of the details about the module, but first things first, a note.
Note: If you previously used the DNN Chat module, and still have it installed, this module will not replace that, the namespaces are different, the Module Name in the Manifest is different. This module WILL NOT UPGRADE the older module. I would suggest uninstalling that module if you still have it, and then installing this module.
Minimum DNN Version: 7.1.0
Source Control Location: https://github.com/ChrisHammond/dnnCHAT
Source Language: C#
Issue Tracking: https://github.com/ChrisHammond/dnnCHAT/issues
Live Demo: http://www.dnnchat.com
Module Description and Features
This module is based on SignalR, utilizing C#, and requires DNN 7.1.0+, it provide basic Chat Room functionality, allowing both Anonymous and logged in users to communicate in the Lobby, logged in users can also join Rooms.
This is an entirely new module, old instances of the DNN CHAT module should be removed before attempting to use this module (they most likely weren't working anyways).
- Chat logging in DotNetNuke Database using DAL2 (logs connections and all messages)
- Ability for users to change their name in the chat window with /nick
- Ability to create rooms with /join, or join existing rooms
- Shows the number of connected chat users when in the room
- Defaults anonymous users are named Anonymous# based on their number in the user queue
- Uses Display Name if the a user is logged in to the DNN site
- Strips all HTML from posts
- Shows when a user connects or disconnects
- Highlights messages that mention your "nick" in a different CSS class
- Shows previous message history when you connect
So if you've been under a rock lately, you might have missed this little phenom known as KickStarter. Well today you're going to want to check it out. Secret Labs, the folks who brought you Netduino (hey, I'm wearing a Netduino t-shirt today, what a coincidence) have teamed up with a watch maker in New York City (SL is based there as well) to bring you Agent! http://www.agentwatches.com/
So what is Agent? I could write this whole long blog post about it, but you'd be better off just reading the KickStarter page.
Basically though, it is a .NET MicroFramework powered device, with long battery life, and awesome features, that will allow you to easily develop for the watch, using the Microsoft tools you already love (Visual Studio 2012).
The project is in a funding phase right now, but I believe the SDK will release by the time the KickStarter campaign ends.
So get to it, fund this project! http://www.kickstarter.com/projects/secretlabs/agent-the-worlds-smartest-watch
Originally posted on ChrisHammond.com, all comments and discussion on this topic should be done there.
This post will provide you with a basic tutorial for utilizing SignalR with custom DotNetNuke Modules. If you want to bypass the blog post go check out the source on GitHub, you can Fork my Repository. The module created here will be very simple, if you want a full blown module with more features be sure to check out the open source DotNetNuke Module SignalRChat, and see it in action at http://dnnCHAT.com/
SignalR is an ASP.NET library for using websockets and long polling in your applications. Basically what this means, is that you can have your web pages (or apps) maintain an open connection with a webserver, passing data back and forth, without having to do standard posts and gets for the content and functions. SignalR is a free library that you can get from www.signalr.net and you can DL from nuget.org right into your Visual Studio projects.
With my new daytime job I had the need to dive deeply into the pool that is SignalR, so I figured what better way to do that than try to create a DotNetNuke module that would use SignalR. There are plenty of Chat examples for SignalR, so I figured that would be a good place to start.
This post assumes you already have a DotNetNuke development environment setup locally at http://dnndev.me, and that you have my Visual Studio templates installed. If you don’t, head on over to the DNN Wiki http://www.dotnetnuke.com/Resources/Wiki/Page/development-environment.aspx
To start, you should create a new DotNetNuke module using my templates, http://christoctemplate.codeplex.com, I used the C# DAL template, but you can use any of the C# templates. The DAL template has less information that will need to be removed than if you use the DAL2 template, the DAL2 template actually has a working sample in it). I called the module I used for this blog DNNSignalR, but you can name yours whatever you want.
Install SignalR into the project using NUGET. To do this open your Package Manager Console (found under Tools/Library Package Manager) in Visual Studio 2012. In the Console run the following line
This will download the SignalR resources into a Packages folder inside of your module’s folder. SignalR provides a variety of resources that will be utilized, as well as an older version of jQuery which will not be used.
Add a Reference
In your project add a reference to DotNetNuke.Web.DLL in the website’s BIN folder, this will allow you to use the Route Mapping in DNN 7.
Map the Route
In order for SignalR to work in DNN7, you need to tell DNN how to handle requests to the path /signalr/hubs/ that path won’t physically exist, due to the way the service framework in DNN7 works this is actually very easy to do.
Add a class to your project called RouteMapper.cs using the code in the screenshot here. (In the sample code check out the /components folder)
Note: If you are using URLMaster, you will need to add |/signalr to the end of the doNotRewriteRegex setting on the Regex Settings tab of the URLMaster Friendly URL Settings module (under the HOST menu).
Create the ChatHub
Creating the View Control
The View Control in this DotNetNuke module is going to be pretty simple, but it also does everything for the module. It will communicate with the ChatHub, with communication happening in both directions. The first thing we’re going to add to the View control are two JS references. You can do this in a number of ways with DotNetNuke, but the easiest way (not necessarily the best) is to just put them in the ASCX file
The HTML for the view control is pretty simple, with a single DNN:LABEL control that will tell the user where they can type. The INPUT file will take the message a user wants to send. The Hyperlink linkSubmit will be used for the click event to send the chat message, and finally the UL called “messages” will be used to display the received messages.
You can go ahead and define the fields shown in this screenshot in the app_localresources/view.ascx.resx file, these values will get populated by DNN in the label, and link on the page.
Packaging and Installing the Module
If you created the module using my module development templates, packaging the module is as easy as switching to Release mode in Visual Studio and compiling the module. Then from the DNN host/extensions page upload the module through the Install Extension Wizard. Once you’ve gone through that process you can place the module on a page.
What the Module Does
The module doesn’t do much, it really just takes a text entry and displays it on the page, you’ll need to open the page in two different browser to really test things out. You’ll notice that the messages are pretty simple and won’t tell you who they are from, but that’s okay, it was just quick and dirty sample module. If you want full blown chat functionality check out SignalRChat module demo’d at http://www.dnnchat.com.
Hopefully this at least gets you started with SignalR though, using SignalR you’ll find that you can really empower your DNN modules to be responsive, without having to write a bunch of webservices to do so.
Download the Source
The Source Code samples for this blog post are available on GitHub
Originally posted on ChrisHammond.com, all comments and discussion on this topic should be done there.
With the 2.0 release of my module development project templates last week I’ve had a few inquiries into how to customize the templates. You can download the templates from http://christoctemplate.codeplex.com/
Why Modify the Templates?
First, why might you want to modify the custom templates? The main reason is that these templates are defined using a specific namespace, DotNetNuke.Modules.*, which is fine in most cases, but what if you want to use your own namespace? Well you have to create a project, then search/replace all instances of that namespace, while not removing any DNN references at the same time. Customizing the project templates will allow you to define your own company namespace, email address, website, and even copyright information, in the template so that you do not have to search/replace every time you create a new project. Read the full post on ChrisHammond.com
Comments are disabled due to the spam problem on asp.net
With the release of DotNetNuke 7.0 (and now the more recent 7.0.2), it was time to update my module development project templates. If you have worked with my module development templates before, here are the major changes for this release. If you haven’t worked with them before please read this whole blog post as I discuss how to get up and running with the templates.
This section will cover some of the “new” features of this template release. If you’re familiar with my previous releases this will hopefully get you up to speed on what is new. If you are new to the whole process it will help you understand a few of the features in the templates.
For more information about the templates read my full blog post on my website.
Comments are turned off here due to the fact that asp.net has a horrible spam problem
In case you haven’t heard, today is our birthday! Back on 12/24/2002, Shaun Walker released an open source project he called (at the time) IBuySpy Workshop in the forums here on www.asp.net. IBSW was a project which containers many enhancements to the IBuySpy Portal that Microsoft had released as a reference app in the early days of the .NET Framework.
Well 10 years later, that application is still here, a few months after that first release it was renamed to DotNetNuke. Check out Shaun’s blog post for a little insight into the early days, and also be sure to check out our 10 Year Timeline/Info Graphic
Is anyone at Microsoft listening to the SPAM problem here on Weblogs.asp.net? My “Can anyone do anything about the spam here on weblogs.asp.net?” post from October got over 12 spam comments posted to it in the past 24 hours. I have comments all moderated, but that just means I have a crapload of work to do each time people comment.
Also, when you click on a link from a comment notification email you are taken to an insecure site warning due to an invalid SSL Cert.
We really just need some updates software, something with better filtering, better captcha, etc. Please, can we get an upgraded weblogs.asp.net sometime in 2013?
It is a big day in the world of DotNetNuke (yes, DNN is still around folks). DNN 7.0 was released today, you can find out more information by visiting DotNetNuke.com
Be sure to read Will Morgenweck’s blog post for all the details.
For a quick peak into DNN 7 check out these two videos, What’s New and Getting Started.
What's new in DNN 7
Getting Started in DNN 7
With the pending release of DotNetNuke 7, scheduled for this week, I updated my free DotNetNuke (DNN) skin, MultiFunction v1.3. This latest release requires DotNetNuke 7, it shouldn’t install on an earlier version of DNN.
This release updates a number of the CSS classes for DNN 7 specific styles and objects. Overall the design of the skin doesn’t really change much, just cleans up CSS mainly for this release.
I also updated to the 3.0 version of the Orangebox jQuery plugin, you can find the code included inside the package.
You can also find the Source package (c#) of the skin there on codeplex, useful if you are looking for an example of how to create/modify a skin for DNN.
If you’re using MultiFunction, I’m curious to see some links to sites that use it, feel free to post in the comments below.
Originally posted on ChrisHammond.com
I was trying to do some work with the Form and List module in DotNetNuke today and I needed to apply some custom styles to the LIST view of a module, without going in and creating a full XSL template for the module to use, I wanted to style the default table based grid view.
In order to customize this view though I needed to do some custom jQuery that runs after the table is loaded, the jQuery then goes through and looks for columns, and based on the number of columns, adjusts the way those columns display.
First I wanted to make it so that a specific column didn’t have text wrapping, which in HTML would normally use the nowrap property on a column, but because of the dynamic nature of F&L you can’t configure that manually. To achieve this I needed to loop through each Table Row (TR) in the table, and then find the column in question, and apply the css attribute/value for white-space/nowrap. To do this I used code like the following.
var cellCount = $(this).find("td").length;
Basically that goes through and finds each row in the table, then checks to see how many columns there are. I do this because the VIEW for the table when you are logged in, versus when you aren’t logged in, is different, the F&L module adds an Edit column at position 0, so you can see in the ELSE statement I basically want to set the width on the 2nd column, position 1 in the zero-based array.
If you want to do something similar for the HEADER row of the table you have to do things slightly differently, using the following code
var cellCount = $(this).find("th").length;
So there you go, you can use that jQuery above to go through and make changes to columns in an HTML table, depending on the location of the cell.
More Posts Next page »