Here's the solution I came up with. I needed to put the Digital Asset Management module on a page, have the user upload a file and then hide the module when the user was done. I start with the module hidden and expose it when the user makes a choice to upload a file. This code is contained in the .ascx file:
<%
int PortalId = PortalController.GetCurrentPortalSettings().PortalId;
//first, we need to get the tabID of the current page:
string PageTabId;
DotNetNuke.Entities.Tabs.TabInfo objTab;
DotNetNuke.Entities.Tabs.TabController objTabs = new DotNetNuke.Entities.Tabs.TabController();
objTab = objTabs.GetTabByName("Album Entry", PortalId); //"Album Entry" is the name of my page
PageTabId = objTab.TabID.ToString();
//next, we'll query the db for our module's ID on the page:
var conString = ConfigurationManager.ConnectionStrings["SiteSqlServer"];
string strConnection = conString.ConnectionString + ";MultipleActiveResultSets=True";
SqlConnection cn = new SqlConnection(strConnection);
cn.Open();
string strSQL = @"select tm.ModuleID
from [dbo].[TabModules] tm
where tm.TabID = '" + PageTabId + @"'
and tm.ModuleTitle = 'AE-Digital Asset Management'"; //"AE-Digital Asset Management" is the title I gave the module
SqlCommand cmdGetModule = new SqlCommand(strSQL, cn);
SqlDataReader rsTabs = cmdGetModule.ExecuteReader();
rsTabs.Read();
//DNN modules all seem to have a standard naming convention -- ddn_ctr<ModuleID>_ModuleContent
string DAMDivID = "dnn_ctr" + rsTabs["ModuleID"].ToString() + "_ModuleContent";
%>
<%--finally, hide the div using a javascript%>
<script type="text/javascript">
document.getElementById('<%=DAMDivID%>').style.visibile = "hidden";
document.getElementById('<%=DAMDivID%>').style.display = "none";
</script>
If you need to have the same module multiple times on a page, simply give it a unique title for each occurrence.
If anyone has any suggestions or comments, by all means, let me know. I hope someone finds this useful.
Chris