一、下面的代码实现
:
<%#DataBinder.Eval(Container.DataItem,"sesuatu")%>
后台代码:
dilindungi int i=1;
private void Page_Load(pengirim objek, System.EventArgs e)
{
XmlSerializer ser = XmlSerializer baru(typeof(DataSet));
DataSet ds = DataSet baru("MyDataSet");
DataTable t = DataTable baru("tabel1");
DataColumn c = DataColumn baru("benda");
t.Kolom.Tambahkan(c);
ds.Tabel.Tambahkan(t);
Baris Data r;
untuk(int saya = 0; saya<10;i++)
{
r = t.Baris Baru();
r[0] = saya;
t.Baris.Tambahkan(r);
}
this.Repeater1 .DataSource =ds.Tables [0].DefaultView ;
ini.Repeater1.DataBind();
}
private void Repeater1_ItemDataBound(pengirim objek, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
jika(i%3==0&&i>0)
{
e.Item.Controls.Add(new LiteralControl("