我在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