<!-- 通过(RepeaterItem)Container.Parent.Parent 可以得到对顶层Item的引用,下面这个id取到的是学校的id -->
<%# ((DataRowView)((RepeaterItem)Container.Parent.Parent).DataItem)["id"] %>:
或
DataBinder.Eval(((RepeaterItem)Container.Parent).DataItem, "CategoryID")
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
int cityID = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "CityID").ToString());
Repeater rplPrice = (Repeater)e.Item.FindControl("rptFlight");
rplPrice.DataSource = GetFlightByStartCityID(cityID);
rplPrice.DataBind();
}
source : http://support.microsoft.com/kb/306154/zh-cn