I have a custom module in a DotNetNuke site. You can see the module in action here: http://www.govoter.org/StateContacts/ProtectionandAdvocacyGroups/tabid/79/Default.aspx
Everything works great, except the link "All State Contact Information". For each state in the list, this should be a link to the page where each state contact information for the given state is presented; for example, for Washington, that page would be: http://www.govoter.org/StateContacts/WashingtonStateData/tabid/110/default.aspx
. This is possible because each state in this list is generated based on data in another table using a datalist & itemtemplate.
We can take the 'WashingtonStateData' out of the target URL for simplicity and just use http://www.govoter.org/StateContacts/tabid/110/default.aspx
. The 'StateContacts' part of the URL is always the same, that's the section name I believe. What differs is the tabid, so this is what I must determine via programming as each state contact info for the full list is rendered.
In the page listing all of the states, the data is pulled by calling up in the information maintained and stored by the StateContacts modules. Therefore, we know the Module ID of each state's data when we load the full list. What I need is to determine how to get the tab id of this module (each module id here will only be on one page/tab, it's unique just like the item id because states are unique). I'm sure it can be done in code, and if that's the only way, I will live with it though I don't know off the top of my head how to do that in DotNetNuke-specific code. I'd prefer to just use the NavigateURL function in the presentation file. See the code below for the current presentation code that displays the entire list of contact info on a page.
Does anyone have some ideas on how I can make this link be dynamic so that it takes the user to the state-specific page? I can share the codebehind if necessary for the backend solution if that's the only way to accomplish this, but I am not sure how I can interact with the DotNetNuke system in the backend to pull meta database information (tabid, etc) for other pages given that I only know the module id. Thanks in advance for any help or suggestions.
<%@ Control language="vb" Inherits="YourCompany.Modules.FullStateContact.ViewFullStateContact" CodeFile="ViewFullStateContact.ascx.vb" AutoEventWireup="false" Explicit="True" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<asp:datalist id="lstStateContacts" datakeyfield="ItemID" runat="server" cellpadding="4">
<table cellpadding="4" width="100%">
<td valign="top" width="100%" align="left">
<asp:Label ID="lblStateAbbreviation" runat="server" CssClass="Normal" Font-Bold="True" /> <asp:HyperLink ID="HyperLink2" NavigateUrl='' runat="server">All State Contact Information</asp:HyperLink>
<asp:Label ID="lblStateContact" runat="server" CssClass="Normal"/>