Professional
DotNetNuke
®
5
Open Source Web Application Framework for ASP.NET
Enhance Your Knowledge
Advance Your Career
Professional ASP.NET 3.5 SP1 Edition
9780470478264
Updated for ASP.NET 3.5 SP1 the author team of Bill Evjen, Scott
Hanselman, and Devin Rader add 250 pages of great new and updated
content compared to the original 3.5 version of the book. This edition
reta ins many great features from previous versions, including both
printed and downloadable VB and C# code examples and great feature
coverage of core ASP.NET. The 3.5 versions focus even more on experi-
enced programmers and advanced web development.
Professional DotNetNuke Module Programming
9780470171165
Written by the DotNetNuke core team members, this book shares best
practices for DNN module development, with each chapter focusing on
one or two core APIs until all of parts of the API are covered. Readers will
learn how to communicate with the API, the importance of adhering to it,
and how to take full advantage of it.
Beginning DotNetNuke Skinning and Design
9780470109632
This book takes readers through the process of designing a skin for a
site. It describes a variety of techniques that can be used in HTML and
CSS development as well as coding a few JavaScript, VB.Net, and C#
statements. By the final chapter, readers will be well versed in the instal-
lation, configuration, and customization of a DotNetNuke website.
Professional DotNetNuke 5: Open Source
93
Chapter 4: Portal Administration
107
Chapter 5: Host Administration
145
Chapter 6: Modules
185
Chapter 7: DotNetNuke Architecture
223
Chapter 8: Core DotNetNuke APIs
243
Chapter 9: Member Role
287
Chapter 10: Client API
303
Chapter 11: Localization
329
Chapter 12: Beginning Module Development
351
Chapter 13: Developing Modules: the Database Layer
377
Chapter 14: Developing Modules: The Business Logic Layer
397
Chapter 15: Developing Modules: The Presentation Layer
419
Chapter 16: Skinning DotNetNuke
459
Chapter 17: Distribution
505
Chapter 18: DotNetNuke’s Commercial Evolution
5
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-43870-1
Manufactured in the United States of America
10987654321
Library of Congress Cataloging-in-Publication Data is available from the publisher.
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by
any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under
Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the
Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center,
222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permis-
sion should be addressed to the Legal Department, John Wiley & Sons., 111 River Street, Hoboken, NJ 07030, (201)
748-6011, fax (201) 748-6008, or online at
http://www.wiley.com/go/permissions
.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties,
including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended
by sales or promotional materials. The advice and strategies contained herein may not be suitable for every
situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting,
or other professional services. If professional assistance is required, the services of a competent professional person
should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an
organization or Web site is referred to in this work as a citation and/or a potential source of further information
About the Wrox DotNetNuke Series Editor
Shaun Walker (MVP, ASPInsider) is co-founder, Vice President of Engineering of DotNetNuke Corpora-
tion and chief architect of DotNetNuke. Shaun has 15 years of professional experience in architecting and
implementing large-scale software solutions for private and public organizations. Shaun is the original
creator and maintainer of DotNetNuke, a web application framework for ASP.NET which has spawned
the largest and most successful Open Source community project on the Microsoft platform. Based on
his significant community contributions he was recognized as a Microsoft Most Valuable Professional
(MVP) in 2004 and an ASPInsider in 2005. He is a frequent speaker at User Groups in his local area and is
a contributing author to the WROX Press books Professional DotNetNuke 4 — Open Source Web Application
Framework and Professional DotNetNuke ASP.NET Portals.
About the Authors
Brian Scarbeau is a Microsoft MVP and a seasoned computer science trainer. He has his MBA and
Certifications as a WebMaster and Network Instructor. He has spoken at various Code Camps about
DotNetNuke
®
and more recently at the DotNetNuke Open Force 0 8 event in Orlando, FL. He has devel-
oped a DotNetNuke
®
curriculum and a series of webcasts for Microsoft Corporation. He was also selected
by Microsoft Corporation to be part of a Faculty Advisory Board. He has traveled the United States and
Canada conducting training seminars on .NET products. Presently, he is on the Board of Directors for the
Computer Science Teacher’s Association and he started the Orlando DotNetNuke
®
User Group. His blog
is here:
http://geekswithblogs.net/bscarbeau
Darrell Hardy has been designing and building data-driven applications for more than 20 years. Having
spent several years working with a management consulting firm, he brings to the table not only technical
expertise but also an understanding of the business side of the equation. His passion is for software that
matches business processes and allows for improvements in the business process as well as the software.
http://www.DotNetNukeConsulting.Wordpress.com
, a DotNetNuke skinning blog at
http://www.dotnetnuke-skin.blogspot.com
, and a development blog at
http://www.ArrowNuke.com
.
About the Technical Editors
Philip Beadle (MCAD, MVP) is a founding member of the DotNetNuke Core Team, a Microsoft
Certified Application Developer, and is experienced in the development and commercial application of
the DotNetNuke framework based on Microsoft’s .NET technology. He has successfully developed and
implemented sites for clients in Australia and overseas and was recently awarded the Microsoft Most
Valuable Professional (MVP) award in ASP/ASP.NET. Philip is a regular contributor to online technical
lists and communities and is a sought-after speaker at technology conferences and .NET User Groups
such as the Victoria .Net Users Group (
http://www.victoriadotnet.com.au/index.aspx?link_id
=
84
).
He recently completed the MSDN update tour for Australia and New Zealand and presented at
Microsoft’s Tech Ed 2005. Philip is employed as a Senior Consultant by Readify (
http://readify
.com.au/Default.aspx?tabid
=
1
), which is a group of elite consultants, specializing in technical
readiness, who help organizations evolve with emerging Microsoft technologies, keeping them a step
ahead of their competitors.
Jon Henning is a senior consultant with Solution Partners Inc. (
http://www.solpart.com
), a
and President of the Orlando DotNetNuke Users Group, and a member of the reformed DotNetNuke
x
Walker f01.tex V3 - 01/22/2009 6:19pm Page xi
About the Wrox DotNetNuke Series Editor
Media Module Project Team. He regularly speaks at local events about DotNetNuke and the various
ways it can be used and managed. Most recently, Will has been publishing DNN videos on JumptStartTV.
Lorraine Young (DNNangel) works as a freelance consultant and maintains a web site at
http://www.dnnangel.com
. She has extensive experience in developing user documentation, and
provides training and support for DotNetNuke applications. She is the primary author of the Wiley Press
DotNetNuke for Dummies book as well as a number of DotNetNuke User Manuals, which are available
from the DotNetNuke Marketplace. She also created and maintains the free DotNetNuke Online Help
resource. Lorraine is a founding member of the DotNetNuke Core Team and a member of the Help
project team. She holds a Bachelor of Arts degree in Professional Writing and Literature and a Post
Graduate degree in Orientation and Mobility for vision-impaired adults and children.
xi
Walker f01.tex V3 - 01/22/2009 6:19pm Page xii
Walker f02.tex V3 - 01/22/2009 6:20pm Page xiii
Credits
Development Editor
Christopher J. Rivera
Production Editor
Rebecca Coleman
Copy Editor
Kim Cofer
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Walker ftoc.tex V3 - 01/22/2009 6:21pm Page xvii
Contents
Introduction xxvii
Chapter 1: An Inside Look at the Evolution of DotNetNuke 1
IBuySpy Portal 2
ASP.NET 2
IBuySpy Portal Forum 5
IBuySpy Workshop 6
Subscription Fiasco 8
Microsoft 9
DotNetNuke 11
Licensing 12
Core Team 13
XXL Fork 16
Trademarks 17
Sponsorship 17
Enhancements 18
Security Flaw 20
DotNetNuke 2.0 22
DotNetNuke (DNN) Web Site 22
Provider Model 23
Open Source Philosophy 24
Stabilization 25
Third-Party Components 26
Core Team Reorganization 26
Microsoft Membership API 27
‘‘Breaking’’ Changes 27
Web Hosters 29
DotNetNuke 3.0 29
Release Schedule 31
More Fundraising 63
CodePlex 64
Security Issues 65
IP Disputes 66
Term Sheets 68
DotNetNuke OpenForce 08 70
DotNetNuke Professional 71
Series A Announcement 72
DotNetNuke 5.0 73
Summary 73
Chapter 2: Installing DotNetNuke Version 5 75
What You Need to Install DNN 5 75
Installing the Starter Kit 86
Upgrading to DotNetNuke 5 89
Common Installation Issues 90
Summary 91
xviii
Walker ftoc.tex V3 - 01/22/2009 6:21pm Page xix
Contents
Chapter 3: Portal Overview 93
Portal Organization Elements 93
Parent/Child Portals 93
Pages 95
Panes 97
Skins 97
Containers 98
Modules 99
User Roles 103
Summary 105
Chapter 4: Portal Administration 107
Host Settings: Basic 147
Host Details 147
Creating the Appearance 149
Host Payment Settings 149
Host Settings Advanced 150
Other Settings 152
jQuery 153
Host Portals 155
Portal Templates 156
Expired Portals 157
Host Module Definition 157
Module Package Settings 160
Installing a New Module 160
Host File Manager 163
Host Vendors 164
Host SQL 164
Host Schedule 164
Schedule Item Details 165
Schedule Status 166
Configuration 168
Considerations 169
Host Languages 169
Installing a New Language Pack 169
Globalization 170
Host Search Admin 172
Host Lists 173
Host SuperUser Accounts 174
Host Skins 177
Create New Skin 178
Install New Skin 178
CBO Hydrator 229
Using the CBO Hydrator 230
Architectural Overview 231
Presentation Layer 232
Business Logic Layer 233
Data Access Layer 234
Data Layer 236
Security Model 238
Security in ASP.NET 2.0 238
DotNetNuke and ASP.NET 2.0 238
Security in DotNetNuke 4.0 239
Namespace Overview 240
Summary 242
Chapter 8: Core DotNetNuke APIs 243
Event Logging 243
The API 244
The Controller Classes 244
Exception Handling 253
The Exception Handling API 253
The Exceptions Class 254
xxi
Walker ftoc.tex V3 - 01/22/2009 6:21pm Page xxii
Contents
Scheduler 258
HTTP Modules 260
HTTP Modules 101 260
DotNetNuke HTTP Modules 263
Module Interfaces 269
IActionable 270
IPortable 278
xxii
Walker ftoc.tex V3 - 01/22/2009 6:21pm Page xxiii
Contents
Chapter 11: Localization 329
Overview 329
Locales in DotNetNuke 329
Resource Files 331
The API 332
The GetString Method 333
The GetSystemMessage Method 337
Token Replacement Engine 343
Localizing Modules 343
Case 1: Handling Static Strings in the ASCX File 345
Case 2: Handling Static Text in Server Controls 345
Case 3: Handling Static Text Programmatically 347
Case 4: Localizing Images 348
Summary 349
Chapter 12: Beginning Module Development 351
Understanding Your Module Project 352
Business Considerations 352
Determine Your Module Scope 354
Development Environment Considerations 354
Starting Development 357
Module Development Options 357
WROX.Suggestion Module Overview 358
Configuring for Module Development 359
Developing with the Starter Kit 368
Summary 376
Chapter 13: Developing Modules: the Database Layer 377
Database Design 378
View Control 421
Secondary View Control 430
Settings Control 436
Edit Control 446
DotNetNuke Helper Functions 454
Exception Handling 454
Navigation URLs 455
Summary 456
Chapter 16: Skinning DotNetNuke 459
ASP.NET 2.0 Master Pages Versus Skinning 460
A Brief Introduction to Master Pages 460
Why DotNetNuke Still Uses Its Skinning Engine 461
File Organization 461
Skin Parsing 462
Building DotNetNuke Skins 464
ASCX Skinning Method 468
Controlling Layout with Panes and Stylesheets 468
Creating a Basic Container 472
Styles Guide — Stylesheet Inheritance and Core DotNetNuke Classes 475
Add Functionality with Skinobjects 476
Client-Side Widget Framework 492
Rotator Widget 494
Pane Collapse Widget 494
PNG Transparency Widget 495
Relocation Widget 495
xxiv