Repeater隔行显示红色

来源:互联网 发布:电脑软件流量统计 编辑:程序博客网 时间:2024/04/30 03:45
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem)
            {
 
                TextBox tb = (TextBox)e.Item.FindControl("TextBox1");
                if (tb.Text.Contains("o"))
                {
                    tb.BackColor = Color.Red; 
                }

            }
        }
0 0
原创粉丝点击