显示效果如下
RepeaterDemo.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RepeaterDemo.aspx.cs" Inherits="RepeaterDemo" %>
<!DOCTYPE html PUBLIC "–//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Repeater ID="repeaterMain" runat="server" OnItemDataBound="repeaterMain_ItemDataBound">
<ItemTemplate>
<table>
<tr>
<td><%#DataBinder.Eval(Container,"DataItem.familyid")%></td>
<td><%#DataBinder.Eval(Container,"DataItem.familyname")%></td>
</tr>
<asp:Repeater ID="repeaterSub" runat="server">
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container, "DataItem.familyid")%></td>
<td><%#DataBinder.Eval(Container, "DataItem.genusid")%></td>
<td><%#DataBinder.Eval(Container, "DataItem.genusname")%></td>
</tr>
<asp:Repeater ID="repeaterSub1" runat="server">
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container, "DataItem.genusid")%></td>
<td><%#DataBinder.Eval(Container, "DataItem.spnumber")%></td>
<td><%#DataBinder.Eval(Container, "DataItem.AbbreviateName")%></td>
</tr>
</ItemTemplate>
original link: <a href='http://Apiaceae.github.io/blog/2009/05/26/Repeater%E6%8E%A7%E4%BB%B6%E5%B5%8C%E5%A5%97%E7%BB%91%E5%AE%9A%E7%A7%91%E5%B1%9E%E6%95%B0%E6%8D%AE/'>http://Apiaceae.github.io/blog/2009/05/26/Repeater%E6%8E%A7%E4%BB%B6%E5%B5%8C%E5%A5%97%E7%BB%91%E5%AE%9A%E7%A7%91%E5%B1%9E%E6%95%B0%E6%8D%AE/</a><br/> written by <a href='http://Apiaceae.github.io'>Hooker</a> posted at <a href='http://Apiaceae.github.io'>http://Apiaceae.github.io</a> </p>