我在ASP.NET C#中使用數據綁定DataList來創建標籤雲。有沒有辦法確保每個標籤都能正確渲染..e.e - 隨着標籤雲的增長,將文檔,流程和團隊組合在一行中?這是我的代碼 - 非常感謝您的幫助!ListView佈局
<div style="padding-left: 25px; padding-right: 25px; text-align: center;">
<asp:listview runat="server" ID="ListView1" ItemPlaceholderID="itemPlaceHolder">
<LayoutTemplate>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
</LayoutTemplate>
<ItemTemplate>
<a href='<%# GenerateNegativeStoryDetails(Eval("Tag")) %>' style="color: #ff0000; text-align: center; margin: 15px; line-height: 30px; text-decoration:none; font-size: <%# GetTagSize(Convert.ToDouble(Eval("weight"))) %>"><%# Eval("Tag") %></a>
</ItemTemplate>
<EmptyDataTemplate>
<asp:Label ID="negative_tags" runat="server" style="color: #ff0000;" Text="[NO NEGATIVE TAGS FOUND]"></asp:Label>
</EmptyDataTemplate>
</asp:listview>
</div>
<br />
<div style="padding-left: 25px; padding-right: 25px; text-align: center;">
<asp:listview runat="server" ID="ListView2" ItemPlaceholderID="itemPlaceHolder">
<LayoutTemplate>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
</LayoutTemplate>
<ItemTemplate>
<a href='<%# GeneratePositiveStoryDetails(Eval("Tag")) %>' style="color: #33cc00; text-align: center; margin: 15px; line-height: 3px; text-decoration:none; font-size: <%# GetTagSize(Convert.ToDouble(Eval("weight"))) %>"><%# Eval("Tag") %></a>
</ItemTemplate>
<EmptyDataTemplate>
<asp:Label ID="positive_tags" runat="server" style="color: #33cc00;" Text="[NO POSITIVE TAGS FOUND]"></asp:Label>
</EmptyDataTemplate>
</asp:listview>
</div>
你可以考慮修改問題標題,因爲您的代碼示例使用ListView,標題表示您需要D協助ataList,完全是一種不同的動物。 – kbrimington 2011-02-26 22:29:52
好點 - 我的錯! – user618616 2011-02-26 22:38:26