My plan is to create a custom attachments control that could be used with any module item.
Since this is my first user control in DNN 4 I wanted to start it really simple. Currently my user control has only one label and this is the code.
<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits=" YourCompany.UI.UserControls.attachments" CodeFile="attachments.ascx.vb" %>
<asp:Label ID="Label1" runat="server" Text="This is my attachments user control"></asp:Label>
This is the pre-compiled file
<%@ control language="vb" autoeventwireup="false" explicit="True" inherits=" YourCompany.UI.UserControls.attachments, App_Web_attachments.ascx.c118b531" %>
<asp:Label ID="Label1" runat="server" Text="This is my attachments user control"></asp:Label>
This is how I use the user control in my module.
<%@ Control language="vb" Inherits="YourCompany.Modules.TestAttachments.ViewTestAttachments" CodeFile="ViewTestAttachments.ascx.vb" AutoEventWireup="false" Explicit="True" %>
<%@ Register Src="~/controls/Attachments/attachments.ascx" TagName="attachments"
TagPrefix="uc2" %>
<%@ Register Src="~/controls/address.ascx" TagName="address" TagPrefix="uc1" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" /><br />
<br />
<asp:ListBox ID="ListBox1" runat="server" Width="217px"></asp:ListBox>
<br />
<br />
<hr />
<br />
<uc1:address ID="Address1" runat="server" />
<br />
<hr />
<br />
<uc2:attachments ID="Attachments1" runat="server" />