Attempted to use the Core Module 0.2.0

Apr 9, 2009 at 12:50 AM
We're using DNN 5.0.1 in a dev environment on a Windows XP - IIS 5.1 and received this error after placing the module on the Home page.

DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl()

Any suggestions are appreciated.
Apr 9, 2009 at 9:36 AM
I haven't tested it on DNN 5 as of yet, and I can imagine, that it will cause issues on the client side due to DNN 5's own jQuery integration. But as to why that would cause an NullReferenceException I cannot say. I will test this right away and get back to you, hopefully with a solution :-)

Best regards,
Apr 9, 2009 at 5:36 PM
Edited Apr 9, 2009 at 5:37 PM
Ok, I finally got around to testing. I was able to reproduce the error, although the error only appears, if you place the module on a page. This is actually not meant to be the way to use the package. This package is meant for developers, who want to use jQuery UI in their modules, for example on their settings pages. To use it, you can simply place the web controls included in the dll on your .ascx'es or instantiate them directly in code. The neccessary plumbing (i.e. including the jquery.js and jquery-ui.js files) is taken care of by the library transparently. Placing the module on a tab is not meant to happen. That is also, why the module, that is actually supposed to appear when adding the module, only includes a message, telling the host administrator to make the module premium, so it will not show in the list of available modules. As for the exception: I'll look into that now. That should not happen ;-)
Apr 9, 2009 at 6:05 PM
Problem found! A simple inherits="DotNetNuke.Entities.Modules.PortalModuleBase" in the jQuery.ascx solves the issue. It will of course be included in the next release. But since the module is not meant to be instantiated as such, I don't consider this a major issue.
Apr 11, 2009 at 5:09 AM
Congrates! this works greate in dotnetnuke 4.x
I've tested it in Mozilla's latest version and the only problem i faced was, the calender popup is behind the slides.
This may be known, i'll try to get arround it and will tell if its fixed.
Can I contribute to the project?
Apr 11, 2009 at 9:53 AM
Hi prashant!

I'm glad, you like the work I've put in the library so far, and would be happy, if you could contribute. Of course, I would first like to see examples of your work. So just check out the code repository, it has anonymous read access, and make the changes you like. Then send me a message containing the changes you made. Perhaps you could work on creating the next web control. Just see the existing controls for examples on how I've done things so far. Currently, the Datepicker is the most advanced control concerning internal feature usage and (important!) documentation.

As for the calendar popup issue: I believe that it is easily solved by setting a z-index. The slider has a z-index of 2 for the handle, the popup does not specify one and is therefore definitely behind it. But I think this should be fixed in jQuery UI and not on our part. I will see, if they already have a ticket for it, and if not, post one.

Best regards,
Sep 12, 2009 at 7:51 PM

Hi Christoph

Very nice work. One small question from a newbie.

Can I have a button to change active tab? Like next / previous page?



Sep 12, 2009 at 9:50 PM

Hi Inge!

I believe, what you are trying to do can be achieved with some simple Javascript using the basic jQuery UI widget features.

Simply add buttons to your page which have an onclick event (OnClientClick property on the ASP.NET button control). The onclick handler can then use the jQuery UI widget's methods to select a different tab:

string clientId = JQuery.JQueryClientId(myTabsControl); // if you use .NET 3.5, you can also use it as an extension method: myTabsControl.JQueryClientId();
nextButton.OnClientClick = "var tabsObj = jQuery('" + clientId + "'); var noOfTabs = tabsObj.tabs('length'); var selectedTab = tabsObj.tabs('option', 'selected'); if (selectedTab < noOfTabs - 1) { tabsObj.tabs('select', selectedTab + 1) }";
prevButton.OnClientClick = "var tabsObj = jQuery('" + clientId + "'); var selectedTab = tabsObj.tabs('option', 'selected'); if (selectedTab > 0) { tabsObj.tabs('select', selectedTab - 1) }";

The idea is to get the currently selected tab, check whether there is a next or previous tab, and if so, select it. I haven't tested the code, but I hope the idea becomes clear.

Best regards,

Sep 13, 2009 at 6:12 PM

Hi Christoph

Very, very helpfull. Thank you. Yes, very clear.

I have been looking for a dual list control. I see there are som for Jquery.

I think that would be a nice addition.




Sep 13, 2009 at 7:36 PM

Hi Inge!

There are so many great widgets for JQuery, it would take a lot of manpower to wrap each and every one into a control. If you have a specific one in mind, you can post a request. I may be able to add a control for it in the near future.

You might also consider simply using the DualListControl that is part of the DotNetNuke framework :-)

Best regards,

Sep 14, 2009 at 1:12 PM

Thank you Christoph

Yes, I will do that. Thankyou for your time.




Oct 12, 2009 at 6:18 AM

Hi Christoph

Is your approach similar to DJ - jQuery Web Contorls for ASP.NET

Do you think it would be possible to get dj wrappers and extend it for use with DNN?

Where can I see DNN Admin demo or source code using jQuery UI DotNetNuke integration module.



Oct 12, 2009 at 7:34 AM

Hi Rad!

There are multiple jQuery DotNet integration libraries available, and I believe they all function similarly, as there aren't that many ways, in which to create a decent integration for ASP.NET. What jQUI-DNN does, is not just offer server controls that automatically create the required markup, and an infrastructure for registering js code on the page, but packages the whole jQuery UI javascript and css code in one neat package for easy installation in DotNetNuke.

This package is by far not as complete as the other available general jQuery ASP.NET integration packages in terms of server controls, which is partly due to my lack of time to continue on the package, but also because no one has requested any further widgets, and so far I have all the widgets I needed in my DNN modules. That said, if you need any further controls, just add a feature request, and I'll get around to implementing it, which usually does not take all too long.

You can see a demo of the integration itself on the demo page This demo is included, when you install the package, as the jQUI-DNN module's default view. You can of course find the code required to use the controls in the included .ascx and .ascx.cs files. But basically, it's similar to the other libraries. Simply start using the controls, they will do the rest for you. And since this project offers such a neat DNN installable package, you don't even have to worry about any folder configuration. Just start using the controls, and you're off.

This library is basically just infrastructure for other modules, so there is no admin interface to it. You shouldn't even use the module itself on a page, since it only shows a demo of the included controls. The installation package is available for the sole purpose of deploying the dll containing the infrastructure and server controls, and deploying the jQuery UI javascript-, css-, and image files, to a central location.

You can of course also use one of the other libraries, but that makes deployment in a DotNetNuke environment more complex. And I've put too much effort into this package to just become a deployment package creator for one of the other libraries. Sorry.

Best regards,