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

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedCreating a Tabbed ModuleCreating a Tabbed Module
Previous
 
Next
New Post
5/11/2013 6:13 PM
 

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

    }


 
New Post
5/12/2013 1:21 PM
Accepted Answer 

Answered my own question.

I found that the errors showing up where certain controls definitely exist in the HTML markup but get flagged by visual studio as not existing in the current context were bogus.

Naturally, since I copied the code from /Admin/Extensions and they were showing up in "my code" in my own module folder the error was mine -- I had to solve why these controls existed but were being flagged.  Well, that is until I saw the same errors show up in the Extensions module!  And it still builds and runs.

So, there may be an oversight in how VS 2010 is configured or something but the errors I get don't affect anything.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedCreating a Tabbed ModuleCreating a Tabbed Module


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