1
是否有任何方式顯示listview作爲另一個listview的空數據模板。我只是把它如下。但它不會顯示列表視圖或它的emptydata文本。僅顯示「空數據列表視圖首」文本在另一個ListView的EmptyDataTemplate中顯示ListView
<asp:ListView ID="searchResults" runat="server" ItemPlaceholderID="placeholder">
<EmptyDataTemplate>
empty data first listview
<asp:ListView ID="suggestions" runat="server" ItemPlaceholderID="placeholder" DataSource="<%#Model.SearchSuggestions %>">
<EmptyDataTemplate>
empty data second listview</EmptyDataTemplate>
<LayoutTemplate>
<span class="suggestionList">
<asp:PlaceHolder ID="placeholder" runat="server"></asp:PlaceHolder>
</span>
</LayoutTemplate>
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
<ItemSeparatorTemplate>
,</ItemSeparatorTemplate>
</asp:ListView>
</EmptyDataTemplate>
<LayoutTemplate>
*************
</LayoutTemplate>
</asp:ListView>
如果刪除字符串「empty data first listview」它仍然不起作用嗎? – MBen
不行不行。我只是把它放在檢查空模板是否工作。 –