Detailed practices of asp.net Repeater nested binding (1/2)

Source: Internet
Author: User

When I was doing something, I had several parent-child tables, for example, news headlines, subtitles, and titles. I used repeater, I once had one, below is one. I have set repeater3 and repeater3 in repeater2 ....

<% 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>
& Nbsp; <% = e. time. tow.timestring () %>
& Nbsp; <% = e. title %>
</P>
<% Last = e. date; %>
<% }%>

Repeater nested binding
Asp tutorial. net code

<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">
& Nbsp; <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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.