//repeater绑定子类
protected void rpBuySellType_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
int ret = 0;
Repeater child = e.Item.FindControl("rpBuySellTypeChild") as Repeater;
DataRowView rowv = (DataRowView)e.Item.DataItem;
int bstID = clsCommon.GetObjToInt(rowv["bstID"]);
if (child != null)
{
DataTable dt = bst.GetBuySellTypeList("*", " and bstIsVouch=1 and bstParentID=" + bstID, " bstOrder desc", 1, this.child_data_count, ref ret);
if (dt.Rows.Count <= 0) dt = bst.GetBuySellTypeList("*", " and bstParentID=" + bstID, " bstOrder desc", 1, this.child_data_count, ref ret);
child.DataSource = dt;
child.DataBind();
}
//if (ids.Length <= 1)
//{
// if (e.Item.ItemIndex == 2)
// {
// Literal ltPic = new Literal();
// ltPic.Text = "<script type='text/javascript' src='/Ajax/ad.ashx?adSN=ad4'></script>";
// this.rpBuySellType.Controls.Add(ltPic);
// }
//}
}
}
Repeater绑定事件
最新推荐文章于 2023-05-26 09:51:24 发布