我做东西的时候,有几个父子关系的表,例如,新闻大标题套小标题,小标题套小小标题,大概几个把,我是用的repeater,一曾一个,下面是一个,我又在repeater2里套了repeater3,repeater3了套了。。。。
<%datetime last = new datetime();
foreach (nonocast.domain.entry e in nonocast.domain.entrymanager.instance.reversefindall()) {
if (!nonocast.domain.kalendar.issameday(last, e.date)) { %>
<% if (nonocast.domain.kalendar.istoday(e.date)) { %>
today
<% } else if (nonocast.domain.kalendar.isyesterday(e.date)) { %>
yesterday
<% } else { %>
<p> <%=e.date.tostring( "d ", system.globalization.datetimeformatinfo.invariantinfo)%> </p>
<% } %>
<% }%>
<p>
<%=e.time.toshorttimestring()%>
<%=e.title%>
</p>
<% last = e.date;%>
<% }%>
repeater嵌套绑定repeater做法
asp教程.net代码
<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 5px" width="100%">
<asp:repeater runat="server" id="rptypelist" onitemdatabound="rptypelist_itemdatabound">
<itemtemplate>
<tr>
<td class="fb">
<a href="lists.aspx?qtid=<%#eval("qtid") %>"><%#eval("qtypename") %></a> <span id="askcount_15"
class="date2">[<%#eval("typecount")%>]</span>
</td>
</tr>
<tr>
<td>
<div id="asktop2_15" class="ask_list">
<asp:repeater runat="server" id="rpquestionlist">
<itemtemplate>
<a href="question.aspx?qid=<%#eval("liftquestionid")%>">
<%#eval("questiontitle")%></a><br />
</itemtemplate>
</asp:repeater>
</div>
</td>
</tr>
</itemtemplate>
</asp:repeater>
</table>
首页 1 2 末页