repeter选中行变色

protected void chk_CheckedChanged(object sender, EventArgs e)
    {
        for (int i = 0; i < rptBasic.Items.Count; i++)
        {
            Boolean isChecked = ((CheckBox)rptBasic.Items[i].FindControl("cbxChild")).Checked;
            if (isChecked)
            {
                HtmlTableRow col = (HtmlTableRow)rptBasic.Items[i].FindControl("tabtr1");
                col.BgColor = "#5F9EA0";
            }
            else
            {
                //#c7c7c7
                HtmlTableRow col = (HtmlTableRow)rptBasic.Items[i].FindControl("tabtr1");
                col.BgColor = "#ffffff";
            }

        }
    }
原文地址:https://www.cnblogs.com/njccqx/p/9672501.html