August 04, 2009

How To Get Design-Time Support for DNN Controls

  As everyone that is a regular reader of this blog is already aware of I am a big fan of the WAP development model for all DotNetNuke development projects.  Now, one of the most common issues that individuals have reported to me is that "design-time" support is not there for common DotNetNuke user controls that are common to integrate with custom modules.  The controls I'm discussing are the DNN Label, Text Editor, and Url Controls.  Luckly though it is VERY simple to get full design time support for the controls and this article will show you how to accomplish this!

The Problem

Before I talk about the simple change that is needed I want to illustrate the problem that we are working to solve.  Specifically you will see the following when looking at the code view of your user control


The green line means that Visual Studio was not able to find the reference for the control listed.  If you switch to design view you will get an issue about not being able to render the control.

The Solution

The best part of all is that this is a very easy issue to solution for.  Right-click on your project and select "Properties".  Switch to the "Web" portion of the settings and you should see the following section.

Simply copy the above listed settings.  The first option "Project Url" specifies the path to the module you are working on, in standard development environments you will just replace "yourmodule" with the name of the module.  The key piece of functionality here is with the "Override application root URL".  This provides design time support to re-map the ~/ application root identifier.  This will allow Visual Studio to properly find the references.

After making this change, you can switch to design view on your project and should see full support for the control, for example the DNN Label Control:


I hope that this has helped you get design time support for common DNN user controls.  If you have any comments or feedback be sure to share them below.  If you need specific technical assistance please use the forums on this site.

tags: DNN, Tutorials, ASP.NET, DNN Development
comments powered by Disqus

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Content Copyright

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.