方法一: protected void rp1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //DataBinder.eval_r(e.Item.DataItem, "数据库字段") //int i = Convert.ToInt32(Databinder.eval_r(e.Item.DataItem,"ID")); Response.Write(DataBinder.eval_r(e.Item.DataItem, "Uname")+" "); } } 方法二: protected void rp1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView drv = (DataRowView)e.Item.DataItem; Response.Write(drv.Row.ItemArray[0].ToString()+" "); } }
原文:http://www.cnblogs.com/qq22144770/p/4841060.html