I have created two custom modules. I have created definitions without a problem. When I add either custom module to a page, I can add more modules, but they do not show up until I delete the first custom module. My modules are really simple. I can add a module that came with DNN 4.4.1 first then my module but after I add my module, any module I add does not show up. =(
HTML:
<%@ Control language="C#" Inherits="TIS.Modules.Roles.ViewRoles" CodeFile="ViewRoles.ascx.cs" AutoEventWireup="false"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<table>tr>
<
<td>
<asp:Label ID="labelAdd" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="11px" Text="Add Route"></asp:Label>
<asp:TextBox ID="textAdd" runat="server" Font-Names="Verdana" Font-Size="11px" MaxLength="100"></asp:TextBox>
<asp:Button ID="buttonAdd" runat="server" Font-Names="Verdana" Font-Size="11px" Text="Add" OnClick="buttonAdd_Click" />
<br />
<br />
</td>tr>tr>
</
<
<td>
<asp:GridView ID="gvRoles" runat="server" AutoGenerateColumns="False" DataSourceID="odsRoles" AllowSorting="True" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" EnableSortingAndPagingCallbacks="True" Font-Names="Verdana" Font-Overline="True" Font-Size="11px" Width="240px" AllowPaging="True" DataKeyNames="Id">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" Visible="False" />
<asp:BoundField DataField="Name" HeaderText="Role" SortExpression="Name" />
</Columns>
<HeaderStyle Font-Bold="True" />
<FooterStyle Font-Names="Verdana" Font-Size="11px" Font-Strikeout="True" />
<PagerStyle Font-Names="Verdana" Font-Overline="True" Font-Size="11px" />
</asp:GridView>
</td>tr>asp:ObjectDataSource ID="odsRoles" runat="server" DataObjectTypeName="TIS.Modules.Roles.Role"
</
<
DeleteMethod="DeleteRole" InsertMethod="AddRole" SelectMethod="GetRoles" TypeName="TIS.Modules.Roles.RoleController"
UpdateMethod="UpdateRole"></asp:ObjectDataSource>
</table>
Code Behind:
using
using
using
using
using
using
using
using
using
using
using
using
using
using
namespace
{
partial class ViewRoles : PortalModuleBase, IActionable
{
#region
private string strTemplate;
#endregion
#region
public bool DisplayAudit()
{
bool retValue = false;
if ((string)Settings["auditinfo"] == "Y")
{
retValue = true;
}
return retValue;
}
#endregion
#region
protected void Page_Load(System.Object sender, System.EventArgs e)
{
}
protected void buttonAdd_Click(object sender, EventArgs e)
{
RoleController rc = new RoleController();
Role role = new Role();
role.Name = textAdd.Text;
rc.AddRole(role);
gvRoles.DataBind();
textAdd.Text = "";
}
#endregion
#region
public ModuleActionCollection ModuleActions
{
get
{
ModuleActionCollection Actions = new ModuleActionCollection();
Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "", this.EditUrl(), false, SecurityAccessLevel.Edit, true, false);
return Actions;
}
}
#endregion
}
}
Optional Interfaces Event Handlers Public Methods Private Members TIS.Modules.Roles DotNetNuke.Services.Localization; DotNetNuke.Services.Exceptions; DotNetNuke.Security; DotNetNuke.Entities.Modules.Actions; DotNetNuke.Entities.Modules; DotNetNuke.Common.Utilities; DotNetNuke; TIS.Modules.Roles; System.Web.UI.WebControls; System.Web.UI; System.Reflection; System.Collections.Generic; System.Collections; System;