我想实现这样的功能
生活资讯 | more.. |
资讯1 | |
资讯1 | |
资讯1 | |
资讯1 | |
资讯1 |
可我做完之后发现,某些情况下,“资讯1”这样的标题会跑到“生活资讯”类别中去,下面是我的代码
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CategorySummary.ascx.cs" Inherits="controls_CategorySummary"%>
<div id="container" style="border:solid 1px #666; margin-top:5px;">
<div id="top" style="width:100%; margin-top:3px;background-color:#EEE;">
<div id="top_left" style="width:70%;float:left">
<span id="categorySpan" runat="server">123</span>
</div>
<div id="top_right" style="float:right; width:30%;">
<a id="moreHref" runat="server">More..</a>
</div>
</div>
<div id="articleSummary" style="margin-top:5px; width:100%;">
<asp:Repeater ID="titleRepeater" runat="server">
<ItemTemplate>
<p style="margin:3px 0">
<a id="titleHref" style="font-size:10pt;white-space:nowrap; overflow:hidden;" runat="server" href='<%# "../Show.aspx?id=" + Eval("Id") %>'><%# Eval("Title") %></a>
</p>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
把
<div id="articleSummary" style="margin-top:5px; width:100%;">
<asp:Repeater ID="titleRepeater" runat="server">
<ItemTemplate>
<p style="margin:3px 0">
<a id="titleHref" style="font-size:10pt;white-space:nowrap; overflow:hidden;" runat="server" href='<%# "../Show.aspx?id=" + Eval("Id") %>'><%# Eval("Title") %></a>
</p>
</ItemTemplate>
</asp:Repeater>
</div>
改为
<div id="articleSummary" style="margin-top:5px; width:100%;">
<ul style="list-style:none;padding:0px;margin:0px;">
<asp:Repeater ID="titleRepeater" runat="server">
<ItemTemplate>
<li>
<a id="titleHref" style="font-size:10pt;white-space:nowrap; overflow:hidden;" runat="server" href='<%# "../Show.aspx?id=" + Eval("Id") %>'><%# Eval("Title") %></a>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
试试