Saturday, 21 May 2011

ModuleSettings and TabModuleSettings Difference in DotNetNuke

If you do not like to read preambula and want to know what is the difference between ModuleSettings and TabModuleSettings, then you can read it here.

Have been worked with it for a long time. Also asked a lot of DotNetNuke gurus, but they did not provide concrete answer about difference between ModuleSettings and TabModuleSettings. In generally it looks the same. For example, we have Settings.ascx. Inside we save some settings, for example Template. So our code should be like this:

Sunday, 8 May 2011

Create User Programmatically in DotNetNuke

One colleague asked about example on how to create user in DotNetNuke programmatically. Here is simple example on C# how to do this:

DotNetNuke Module Development Certification

Last Friday have successfully passed 2 certifications: DotNetNuke Module Development Certification and DotNetNuke Professional Certification. Both are 100% successfully done. Very good feeling after it.

This info should be published at DotNetNuke official site within new Partners Directory and should make more clear selection process for customers.

PS: Will add link, once it will be available at the official DNN site.

DotNetNuke Unauthenticated Users Cache Bug

This is very popular bug for Unauthenticated Users in DotNetNuke. User arrives to the page, clicks link and nothing happens! It looks like page does not refresh at all. No PostBacks, nothing. And this gluck happens only for Unauthenticated Users. When user is logged in, then everything works fine.

This bug relates to the Cache Settings of the module. It can be fixed in few clicks:

  1. Go to the Settings of the module.
  2. Scroll down to the "Page Settings" - "Basic Settings" and expand it.
  3. There is a param "Cache Duration (seconds)". By default it is different from zero. You should set it to zero. It fixes problem.

Hope this helps!

Saturday, 7 May 2011

Custom Event In The Custom Control

It is good rule to add Custom Events in the Custom Controls you build. It allows easy to use your control from the external code without any problems.

How to add Custom Event? Very easy, just add this code to your class:


// delegate declaration

public delegate void ChangingHandler(object sender);

// event declaration

public event ChangingHandler OnDoFilter;

// this one is to call event

private
void FireOnDoFilter(object sender)
{
  if (OnDoFilter != null)
  {
    OnDoFilter(sender);
  }
}


Custom Events are easy to create and easy to use. Lets use it!

Hope this helps!

Friday, 6 May 2011

DotNetNuke Telerik Editor ToolBars

Each DotNetNuke developer can easy add RichEditor to the project. All what you need is to add control to your .ascx file, like this:


<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx" %>

<dnn:TextEditor runat="server" id="tbFirst" DefaultMode="BASIC"></dnn:TextEditor>
<dnn:TextEditor runat="server" id="tbSecond" DefaultMode="RICH"></dnn:TextEditor>


This code adds two  RichEditors. One like simple textbox (DefaultMode="BASIC") and another fully WYSIWYG . RichEditor with WYSIWYG looks like this:

This is great! Users like it to use. It has a lot of ToolBars. Control provides very good functionality. But sometimes it needs to remove some ToolBars. So how to do this in the DotNetNuke module?

Thursday, 5 May 2011

DataExporter for DotNetNuke

Very often Administrators and Developers of DotNetNuke have to work with data from the DataBase. Usually it needs to receive and to process the DataSet or transmit for processing into another application.

forDNN Team has made this module to make process of retrieving data from the DB more easy.

This module is pretty simple and fast. It allows to select DataSource: table, view or a custom query. List of tables and the view presented in the form like DropDowns. DropDowns contains names and number of entries for each of table/view. 

Also module allows to choose the format in which data will be exported from the database. It supports three data formats: Excel, XML and CSV. 

Module is available at the CodePlex: Installation and Source.

DotNetNuke Not Uniq Emails

Sometimes clients ask to make registration at the site with uniq emails only. It somehow prevents to appear duplicates of the users. But sometimes site is live already and have a lot of registered users, then it needs to find all users with not uniq emails in DB and to fix. It is possible with query like this:

SELECT UserID, UserName, FirstName, LastName, Email, DisplayName
FROM {databaseOwner}{objectQualifier}Users
WHERE Email IN
(
SELECT Email
FROM {databaseOwner}{objectQualifier}Users
GROUP BY Email
HAVING COUNT(Email)>1
);

Hope this helps!

Tuesday, 3 May 2011

JavaScript Object: Properties and Methods

Sometimes it needs to get list of Properties and Methods of the JavaScript Object. Its very easy to do with code like this::

var keysValues = "";
for(var keyName in myObject)
{
    keysValues += keyName + " = " + myObject[keyName] + ", ";
}
alert(keysValues);

This code shows list of all Properties and Methods of myObject.

Hope this helps!

The most stupid advertising...

The most stupid decision about advertising of the module for DotNetNuke was banner at the site AllDnnSkins. Small price $100 per month, but  prepayment for 3 months forward. And only 5 visitors from this site per month! $20 per visitor - real shit. Experience is crazy expensive.