DotNetNuke Modules - DNN Controls - Label
The DotNetNuke framework has several built-in controls that you should use instead of the controls you would typically use in an ASP.NET application. Before we can go much further, we need to review the controls that are available so that you know what is available prior to starting your development efforts. Not doing so would be like starting to develop in ASP.NET without learning what ASP.NET controls are available to you instead of the HTML controls you were used to using in ASP. Today’s post covers the most common of those controls, the DNN:Label control.
The DNN:Label control is probably the most frequently used control in DotNetNuke. This control is a plug-in replacement for the standard ASP:Label control you are use to using in ASP.NET. However, it embellishes the functionality in several respects.
- It provides a help icon that will display a help message when the user clicks on the icon or if the mouse hovers over the icon.
- The whole control is wrapped in a <label for=”…”> block to associate the label with an input element on the screen so that your application is automatically 508 enabled.
- It provides a standard way of pushing all of your text strings into a resource file for internationalization purposes.
There are five properties that should be supplied to this control in your mark up:
| ControlName | This property specifies the ID of the control that the label is a label for. It’s the FOR attribute of the <label for=”…”> block. |
| ResourceKey | This is an optional property that can specify the resource key to use for internationalization purposes. If this key is not provided, the ID property will be used followed by “.Text” to look for the string in the resource file. So, if the ID of the control is “Label1″, the key would be “Label1.Text”Of course, if you hard-wire the Text property, it won’t look for anything in the resource file. |
| HelpKey | Similar to Resource key, this is an optional parameter. If this key is not provided, the ID property will be used followed by “.Help”. |
| Suffix | Suffix is another optional parameter that will allow you to add a string to all text that populates the Text property. You can use this to append a colon at the end of all of your labels. |
| Text | This is the default text. this is used if no localization text can be found. You may want to use this if you want to see what your screen is going to look like as you are designing it. I generally leave it blank. |
You may be wondering about this whole “resource file” thing. I had a choice of covering resource files first, or introducing a control first. Both have their problems, but I think introducing a control first gives us some context for the “resource file” issue that we wouldn’t otherwise have if we had covered resource files first. So, hang on, we’ll get to resource files soon.
Other post in DotNetNuke - Module Development
- Creating DotNetNuke Modules - May 20th, 2008
- Creating DNN Modules - The Tools - May 22nd, 2008
- DotNetNuke Modules - Foundational Concepts - May 26th, 2008
- DotNetNuke Modules - Install DNN into VS 2008 - May 27th, 2008
- DotNetNuke Modules - Creating Base Modules - May 28th, 2008
- DotNetNuke Modules - Registering Your Module - May 29th, 2008
- DotNetNuke Modules - Where Stuff Shows Up - June 3rd, 2008
- DotNetNuke Modules - Benefits of Architecture - June 4th, 2008
- DotNetNuke Modules - Anatomy of the View - June 9th, 2008
- DotNetNuke Modules - Adding Actions - June 11th, 2008
- DotNetNuke Modules - DNN Controls - Label - June 18th, 2008
- DotNetNuke - Internationalization - June 25th, 2008
- DotNetNuke Modules - Internationalization (part 2) - June 30th, 2008
- DotNetNuke Modules - Labels w/ no Help - July 9th, 2008
- DotNetNuke Modules - LinkButtons - July 14th, 2008
- DotNetNuke Modules - Collapsible Panels - July 16th, 2008
- DotNetNuke - The Data Layer - Installing CodeSmith - July 22nd, 2008
- DotNetNuke - Modules - Creating The Tables - July 24th, 2008
- DotNetNuke - Modules - Creating Stored Procs - July 29th, 2008
- DotNetNuke - Modules - Portal Specific Modules - July 31st, 2008
- DotNetNuke Modules - Data Access Layer - August 5th, 2008
- DotNetNuke Modules - Data Access Layer - August 7th, 2008
- DotNetNuke - Data Access Layer Alternative - August 12th, 2008
- DotNetNuke - Modules - Linking within the module - August 14th, 2008
- DotNetNuke - Make Your Module Searchable - August 19th, 2008
- DotNetNuke Modules - Making Content Portable - August 25th, 2008
- DotNetNuke Modules - Exceptions the DNN Way - September 2nd, 2008
- DotNetNuke Modules - PortalModuleBase - September 4th, 2008
- DotNetNuke Modules - Inter Module Communication - September 9th, 2008
- DotNetNuke Modules - Finding The Page a Module is On - September 15th, 2008
- DotNetNuke Modules - Caching - September 17th, 2008
- DotNetNuke Modules - Module Settings - September 22nd, 2008
- DotNetNuke Modules - Retrieving Settings - September 24th, 2008
- DotNetNuke Modules - Advanced Architecture - October 20th, 2008
- DotNetNuke Modules - Creating the PA - October 30th, 2008
- DotNetNuke Modules - Automating the PA - November 5th, 2008
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

