I'm missing something easy and obvious. I'm on DNN 7.x for a client and I'm getting used to writing modules the "new" way vs. 4.x and 5.x.
I need a tabbed module, copying the Extensions.ascx, code behind, resource file, module.css seemed easy enough a start.
However, I'm getting an error that the controls such as installedExtensionsControl can't be found. Of course I'll rename that. I've renamed availableExtensions to CreatePortals.
The code is bulky but here it is. The error I'm getting is CreatePortalsControl can't be found. This is one. The other is, installedExtensionsControl can't be found.
In the markup the controls are clearly there. Usually, these reference a designer file and I'm not seeing that. Then again, there is no designer file in the original location for these files. The namespace is right.
So, I'm missing something incredibly simple, just don't know this module model and don't see what it is.
Thanks for any help.
Markup
<%@ Control Language="C#" AutoEventWireup="false" Inherits="DTSABFR.CreatePortals.SalesRepControls" CodeFile="SalesRepControls.ascx.cs" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls"%>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.WebControls" Namespace="DotNetNuke.UI.WebControls"%>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="CreatePortals" Src="~/DesktopModules/DTS_ABFR_Create_Portals/CreatePortals.ascx" %>
<%@ Register TagPrefix="dnn" TagName="CreateSalesRep" Src="~/DesktopModules/DTS_ABFR_Create_Portals/CreateSalesRep.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PurchasedExtensions" Src="~/DesktopModules/Admin/Extensions/PurchasedExtensions.ascx" %>
<%@ Register TagPrefix="dnn" TagName="MoreExtensions" Src="~/DesktopModules/Admin/Extensions/MoreExtensions.ascx" %>
<script type="text/javascript">
/*globals jQuery, window, Sys */
(function ($, Sys) {
function setUpDnnExtensions() {
//$('#dnnExtensions').dnnTabs().tabs('select', window.location.hash).dnnPanels();
$('#dnnExtensions').dnnTabs().tabs().dnnPanels();
$('#CreatePortals .dnnFormExpandContent a').dnnExpandAll({
expandText: '<%=Localization.GetSafeJSString("ExpandAll", Localization.SharedResourceFile)%>',
collapseText: '<%=Localization.GetSafeJSString("CollapseAll", Localization.SharedResourceFile)%>',
targetArea: '#CreatePortals'
});
$('#installedExtensions .dnnFormExpandContent a').dnnExpandAll({
expandText: '<%=Localization.GetSafeJSString("ExpandAll", Localization.SharedResourceFile)%>',
collapseText: '<%=Localization.GetSafeJSString("CollapseAll", Localization.SharedResourceFile)%>',
targetArea: '#installedExtensions'
});
}
$(document).ready(function () {
setUpDnnExtensions();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
setUpDnnExtensions();
});
if (location.hash) {
$("a[href=" + location.hash + "]").click();
}
});
} (jQuery, window.Sys));
</script>
<ul class="dnnActions dnnRight dnnClear">
<li><asp:Hyperlink id="cmdInstall" runat="server" CssClass="dnnPrimaryAction" resourcekey="ExtensionInstall.Action" /></li>
<li><dnn:ActionLink id="createExtensionLink" runat="server" ControlKey="NewExtension" CssClass="dnnSecondaryAction" resourcekey="CreateExtension.Action" /></li>
<li><dnn:ActionLink id="createModuleLink" runat="server" ControlKey="EditModuleDefinition" CssClass="dnnSecondaryAction" resourcekey="CreateModule.Action" /></li>
</ul>
<div class="dnnForm dnnExtensions dnnClear" id="dnnExtensions">
<ul class="dnnAdminTabNav dnnClear">
<li id="installedExtensionsTab" runat="server" visible="false"><a href="#installedExtensions"><%=LocalizeString("InstalledExtensions")%></a></li>
<li id="CreatePortalsTab" runat="server" visible="false"><a href="#CreatePortals"><%=LocalizeString("CreatePortals")%></a></li>
<!-- <li id="purchasedExtensionsTab" runat="server" visible="false"><a href="#purchasedExtensions"><%=LocalizeString("PurchasedExtensions")%></a></li>
<li id="moreExtensionsTab" runat="server" visible="false"><a href="#moreExtensions"><%=LocalizeString("MoreExtensions")%></a></li> -->
</ul>
<div id="installedExtensions" class="exInstalledExtensions dnnClear">
<div class="dnnFormExpandContent"><a href=""><%=Localization.GetString("ExpandAll", Localization.SharedResourceFile)%></a></div>
<dnn:InstalledExtensions id="installedExtensionsControl" runat="Server"/>
</div>
<div id="CreatePortals" class="exAvailableExtensions dnnClear">
<div id="CreatePortalsTabExpand" runat="server" Visible="false" class="dnnFormExpandContent">
<a href=""><%=Localization.GetString("ExpandAll", Localization.SharedResourceFile)%></a></div>
<div class="exaeContent dnnClear">
<dnn:CreatePortals id="CreatePortalsControl" runat="Server" Visible="false"/>
</div>
</div>
<!-- <div id="purchasedExtensions" class="exPurchasedExtensions dnnClear">
<div class="exmeContent dnnClear">
<dnn:PurchasedExtensions id="purchasedExtensionsControl" runat="Server" Visible="false"/>
</div>
</div>
<div id="moreExtensions" class="exMoreExtensions dnnClear">
<div class="exmeContent dnnClear">
<dnn:MoreExtensions id="moreExtensionsControl" runat="Server" Visible="false"/>
</div>
</div> -->
</div>
Code Behind
#region Usings
using System;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Entities.Users;
using DotNetNuke.Framework;
using DotNetNuke.Security;
using DotNetNuke.Services.Installer;
using DotNetNuke.Services.Localization;
using DotNetNuke.UI.Modules;
#endregion
namespace DTSABFR.CreatePortals
{
/// <summary>
/// The Extensions Module Control is used to manage the Extensions
/// installed in this portal
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// [cnurse] 01/04/2008 Created
/// </history>
public partial class SalesRepControls : ModuleUserControlBase
{
#region Protected Methods
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
cmdInstall.NavigateUrl = Util.InstallURL(ModuleContext.TabId, "");
cmdInstall.Visible = ModuleContext.PortalSettings.UserInfo.IsSuperUser;
createExtensionLink.Visible = ModuleContext.IsHostMenu;
createModuleLink.Visible = ModuleContext.IsHostMenu;
jQuery.RequestDnnPluginsRegistration();
installedExtensionsControl.LocalResourceFile = LocalResourceFile;
installedExtensionsControl.ModuleContext.Configuration = ModuleContext.Configuration;
installedExtensionsTab.Visible = true;
installedExtensionsControl.Visible = true;
if (ModuleContext.PortalSettings.ActiveTab.IsSuperTab)
{
CreatePortalsControl.LocalResourceFile = LocalResourceFile;
CreatePortalsControl.ModuleContext.Configuration = ModuleContext.Configuration;
CreatePortalsTab.Visible = true;
CreatePortalsControl.Visible = true;
CreatePortalsTabExpand.Visible = true;
}
/* if (ModuleContext.PortalSettings.ActiveTab.IsSuperTab)
{
purchasedExtensionsControl.LocalResourceFile = LocalResourceFile;
purchasedExtensionsControl.ModuleContext.Configuration = ModuleContext.Configuration;
purchasedExtensionsTab.Visible = true;
purchasedExtensionsControl.Visible = true;
} */
/* if (ModuleContext.PortalSettings.ActiveTab.IsSuperTab)
{
moreExtensionsControl.LocalResourceFile = LocalResourceFile;
moreExtensionsControl.ModuleContext.Configuration = ModuleContext.Configuration;
moreExtensionsTab.Visible = true;
moreExtensionsControl.Visible = true;
CreatePortalsTabExpand.Visible = true;
} */
}
#endregion
}
}