Repeater小问题
使用Repeater的时候,我想根据一个绑定控件的值来控制另一个控件是否显示,应该怎么写?
------解决方案--------------------请参考
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
DataRowView row;
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
row = (DataRowView)e.Item.DataItem;
if (row[ "authors "].ToString().Trim() == string.Empty)
{
img = (Image)e.Item.FindControl( "NewsImage ");
img.Visible = false;
}
}
}