特定行我有一个中继器和dataItembound我有这样的事情编辑在ASP中继
((HtmlTableRow)e.Item.FindControl("prodName")).Visible = false;
然而,这将在转发所有tablerows是无形的。我想要一个特定的隐藏。有没有办法做到这一点?
继承人的全小鬼
protected void RepeaterCategories_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
//Get category id
string catId = Request.QueryString["stctid"];
//Call function to check stock levels in the next loaded category
bool stock = checkCategoryStockLevels(catId);
if(stock == true)
{
((HtmlTableRow)e.Item.FindControl("catName")).Visible = false;
((HtmlTableRow)e.Item.FindControl("catImg")).Visible = false;
}
}
请出示全面实施您的OnDataItemBound事件...... –
我知道了。 (repeaterID.Items.Count; count ++) for(int repeaterCount = 0; count