I am trying to create an add-on that allows the creation of reports (from our ERP system). There are some things I don't understand and working on, such as only allowing access to specific reports based on roles (I will look in the documentation more about this). This post is to get information on how to display the reports. I would like to display them like this, unless someone else has a better idea on how to display them. There are two tables, groups and reports.
* Group 1
* Report 1
* Report 2
* Report 3
* Group 2
* Report 1
* Report 2
* Report 3
I am using a ListView. The problem comes in when I try to use another ListView inside. Right now I am using SqlDataSource for testing purposes, but can't figure out how to access the control outside the inner listView if that makes any sense. Here is the code.
<asp:ListView ID="ListView1" runat="server" DataKeyNames="GroupID" DataSourceID="SDS1">
<EmptyDataTemplate>
No data was returned.
</EmptyDataTemplate>
<ItemSeparatorTemplate>
<br />
</ItemSeparatorTemplate>
<ItemTemplate>
<li style=""><asp:Label ID="GroupIDLabel" runat="server" Text='<%# Eval("GroupID") %>' Visible="false" />
<strong><asp:Label ID="GroupNameLabel" runat="server" Text='<%# Eval("GroupName") %>' /></strong><br />
<asp:Label ID="GroupDescriptionLabel" runat="server" Text='<%# Eval("GroupDescription") %>' />
<asp:ListView ID="ListView2" runat="server" DataKeyNames="ReportID" DataSourceID="SDS2"
ItemPlaceholderID="itemPlaceholderContainer2">
<EmptyDataTemplate>
</EmptyDataTemplate>
<ItemTemplate>
<li style="">
<asp:Label ID="ReportIDLabel" runat="server" Text='<%# Eval("ReportID") %>' />
<br />
<asp:Label ID="ReportNameLabel" runat="server" Text='<%# Eval("ReportName") %>' />
</li>
</ItemTemplate>
<LayoutTemplate>
<ul id="itemPlaceholderContainer2" runat="server" style="">
<li runat="server" id="itemPlaceholder2" />
</ul>
<div style="">
</div>
</LayoutTemplate>
</asp:ListView>
</li>
</ItemTemplate>
<LayoutTemplate>
<ul id="itemPlaceholderContainer" runat="server" style="">
<li runat="server" id="itemPlaceholder" />
</ul>
<div style="">
</div>
</LayoutTemplate>
</asp:ListView>
<asp:SqlDataSource ID="SDS1" runat="server" ConnectionString="Data Source=mandb02\sqlexpress;Initial Catalog=ManconWeb;User ID=manconweb;Password=passthebox"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [GroupID], [GroupName], [GroupDescription], [Default_Roles_Allow] FROM [RRD_Reports_Groups]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SDS2" runat="server" ConnectionString="Data Source=mandb02\sqlexpress;Initial Catalog=ManconWeb;User ID=manconweb;Password=passthebox"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT ReportID, GroupID, ReportName, ReportCreated, ReportUpdated FROM RRD_Reports_List WHERE (GroupID = @GroupID)">
<SelectParameters>
<asp:ControlParameter ControlID="GroupIDLabel" Name="GroupID"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
I get the following error: Could not find control 'GroupIDLabel' in ControlParameter 'GroupID'.