Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.


Using the DNN Label Edit Control

I am working on a comprehensive tutorial that will demonstrate all the DotNetNuke web controls. The development and documentation of the DotNetNuke web controls has been led by Core member Jon Henning. What I am attempting to do is demonstrate the fast easy ways to implement these extremely useful controls.

As a preview I decided to cover the DNNLabelEdit control.

Most of us are familiar with the ability to edit the title of a DotNetNuke module. You simply click on it while logged in as the portal Administrator:

Make your changes:

And click away from the label to save your changes:

 

Here are the steps to implement this web control in your own modules. This works with the full version of Visual Studio 2005 and also Visual Web Developer Express edition.

  1. Right-Click on the Toolbox in Visual Studio and select Choose Items...

     
  2. Use the Browse button to browse to DotNetNuke.WebControls.dll (in the /bin folder of your DotNetNuke installation) and click the OK button.
  3. The DotNetNuke web controls will now appear in your toolbox:

     
  4. Drag the DNNLabelEdit control from the toolbox and drop it on to your DotNetNuke Web User Control (See my tutorial Creating a  Super-Simple DotNetNuke module for information on how to create a DotNetNuke Web User Control) .

     
  5. In the properties for the control, Set the Text property to "Hello"

     
  6. Save the page and view it in the web browser

     
  7. Click on the word "Hello" and type "World!" at the end.
  8. Click away from the label and the label has been updated

Now you're probably thinking "But, how do I save the changes?". Let's alter the code to save the changes to the module settings. There is a method that is exposed by the DotNetNuke API that allows you to save module settings that are specific to that instance of the module (meaning, each time you place the module in the portal the settings for each instance is kept separate).

  1. In the properties for the DNNLabelEdit control, click on the yellow lazerbolt to show the events for the control
  2. Great, now we see that there are useful events (Thanks Jon!) that we can wireup a method to. Type "SaveTheChange" for the UpdateLabel event and click away from the box.
  3. Visual Studio switches to code view and your method is all ready for your custom code.
  4. Ensure that your Web User Control has this line toward the top:  Inherits Entities.Modules.PortalModuleBase
  5. Enter this code in the method so it appears like this:


     
  6. Alter the Page_Load method (or create one if you don't already have one) to this:


     
  7. Save the page and refresh the web browser. The changes you make will now be saved.
  8. You can download the code here.

This was a really simple example. The real fun will be when we cover the other controls like DnnTextSuggest, DNNMenu, and DnnTree in future tutorials.

DNNTextSuggest will perhaps have the biggest impact to your development efforts. Allowing users to simply hit the Enter key when "Perpetual Motion Interactive Systems Inc" appears after only typing in "perp" will greatly enhance the user experience.

 

Comments

There are currently no comments, be the first to post one.

Comment Form

Only registered users may post comments.

NewsArchives


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Daniels (3)
Alex Shirley (10)
Andrew Hoefling (3)
Andrew Nurse (30)
Andy Tryba (1)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (37)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Bogdan Litescu (1)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (213)
Chris Paterra (55)
Clint Patterson (108)
Cuong Dang (21)
Daniel Bartholomew (2)
Daniel Mettler (181)
Daniel Valadas (48)
Dave Buckner (2)
David Poindexter (12)
David Rodriguez (3)
Dennis Shiao (1)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (80)
Francisco Perez Andres (17)
Geoff Barlow (12)
George Alatrash (12)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (274)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Kelly Ford (4)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matt Rutledge (2)
Matthias Schlomann (16)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Miguel Gatmaytan (3)
Mike Horton (19)
Mitchel Sellers (40)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Oliver Hine (1)
Patricio F. Salinas (1)
Patrick Ryan (1)
Peter Donker (54)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Sacha Trauwaen (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott Schlesier (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Steven Fisher (1)
Tony Henrich (3)
Torsten Weggen (3)
Tycho de Waard (4)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (40)
Will Strohl (180)
William Severance (5)
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out