I’m using a ListView in an instance where I’d like to have two Item placeholders in the same LayoutTemplate. Is this possible? My use case is the following. I’m using jQuery tabs and want to output the tabs based on the data in the binding. So for instance this is what I want:
<div id="tabcontainer">
<ul>
<li>Tab 1 name</li>
<li>Tab 2 name</li>
....
</ul>
<div>
Tab 1 contents
</div>
<div>
Tab 2 contents
</div>
...
</div>
So basically each tab will be one item my databinding, but I need to have two different item templates inside of the LayoutTemplate so something like this I’m guessing:
<asp:ListView runat="server" ID="ForecastListView">
<LayoutTemplate>
<div id="container">
<ul>
<asp:Placeholder runat="server" ID="itemPlaceholder1" />
</ul>
</div>
<asp:Placeholder runat="server" ID="itemPlaceholder2" />
</LayoutTemplate>
<ItemTemplate1>
<%# Eval("TabName") %>
</ItemTemplate1>
<ItemTemplate2>
<div>
<%# Eval("TableContents") %>
</div>
</ItemTemplate2>
</asp:ListView>
Obviously that doesn’t work, but something along those lines maybe?
Seems like it would be easier to simply define two ListViews – one for each of the logical jQuery tabs. The ListViews would be supplied with the same DataSource, but would render the data very differently.