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:

Conclusion

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.

Posted by Mitchel on Tuesday, August 04, 2009
 

Comments

Is it for VS2005 or VS2008?

By Rexha on Wednesday, August 05, 2009 at 4:33 AM

Works in 2008... thanks Mitch!

By Rodney Joyce on Monday, September 07, 2009 at 3:50 AM

There exists a similiar problem for DNN controls. Every time I made some changes in xxx.ascx, the dnnEditor will be modified into UserControl type. Why? Could you explain it? Thanks a lot.

By Baldwin on Monday, November 09, 2009 at 3:36 AM

Okey, please ignore my comment above. You solution also have fixed our issue. Great, thanks a lot.

By Baldwin on Wednesday, November 11, 2009 at 6:07 PM

Very useful!

Can a similar setting be found for the CSS classes? These standard DNN classes (such as SubHead) also have green wiggly lines.

By Ernst Peter Tamminga on Wednesday, April 28, 2010 at 2:51 AM

Hi Ernst,

Try this for getting the CssClass to work in the designer:

By Dan Gilleland on Sunday, September 05, 2010 at 8:38 AM

Name (required)

Email (required)

Website

CAPTCHA image
Enter the code shown above:

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.

Friend of RedGate

www.datasprings.com - DotNetNuke Modules ICG Hosting

Click here for advertising information.

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.