asp.net 最好用的数据控件莫过于Repeater 数据控件,主要的嵌套代码如下所示:
protected void CityList_rp_ItemDataBound(object sender, RepeaterItemEventArgs e)
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater _Disctrictlist_rp =(Repeater)e.Item.FindControl("Disctrictlist_rp");
DataRowView drv = (DataRowView) e.Item.DataItem;
jtwxWP Disctrict = new jtwxWP();
DataTable dt = Disctrict.AreaList(_db,Convert.ToInt32(drv["cityid"].ToString()));
if(dt!=null)
{
_Disctrictlist_rp.DataSource = dt;
_Disctrictlist_rp.DataBind();
}
}
}