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?