e.Item.ItemType
下面是我在repeater里面找panel控件的代码,who帮忙解释下为什么要判断当前点击的项啊,这和找控件有什么关系啊?protected void Repeater1_ItemCommand1(object source, RepeaterCommandEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Panel pan1 = (Panel)e.Item.FindControl("Panel1");
if (pan1.Visible == false)
{
pan1.Visible = true;
}
else
{
pan1.Visible = false;
}
//datatbind(wtID4);
}
}