Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

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!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Partial Classes and User ControlsPartial Classes and User Controls
Previous
 
Next
New Post
11/22/2006 2:15 PM
 

I have developed a few modules using DNN3 and Visual Studio.Net 2003, and want to start developing these modules using Visual Studio 2005 and DNN4.

One thing I have enjoyed working with in DNN3 was the built in DNN User controls like dnn:label and portal:url.  However, I seem to be having a hard time getting these to work with the new partial class structure. 

For example, I want my settings page to just have a standard DNN label with the help questionmark and a tab selection.

I have added the following code to the top of my settings ascx control:

<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx"%>
<%@ Register TagPrefix="Portal" TagName="URL" Src="~/controls/URLControl.ascx"%>
<table cellspacing="0" cellpadding="2" border="0"
>
<tr
>
<td class="SubHead" width
="150">
<dnn:label id="lblParentPage" runat="server" controlname="txtTemplate" suffix=":"></dnn:label
>
</td
>
<td valign="bottom"
>
<portal:url id="urlParentPage" runat="server" width="300" showtabs="True" showfiles="False"
showUrls="False" urltype="F" showlog="False" shownewwindow="False" showtrack="False"
/>
</td
>
</tr
>
</
table>

In Visual Studio.Net 2003, I would have declared these in my codebehind, as below, and then I would have been able to access all the custom properties of these two types of user controls:

Protected WithEvents lblParentPage As DotNetNuke.UI.UserControls.LabelControl
Protected WithEvents urlParentPage As DotNetNuke.UI.UserControls.UrlControl

However, in Visual Studio 2005, it wants to make my code behind a partial class, which declares these as System.Web.UI.UserControls.  Thus, I don't get programmatic access to any of the custom properties or fields of these controls.

Ideally, I would like to keep using the Partial classes, since it is nice not to have to declare all my controls manually.  Is there any way for me to tell Visual Studio.Net 2005 that these are LabelControl and an UrlControl specifically?  Maybe by using the Assembly and Namespace attributes of the <@Register> Directive?

If not, is there a way to tell Visual Studio .Net 2005 not to create the partial class for my user control?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Partial Classes and User ControlsPartial Classes and User Controls


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out