Repeater中获得控件引用

来源:互联网 发布:怎么查淘宝店铺排名 编辑:程序博客网 时间:2024/05/21 01:57
        foreach (RepeaterItem r in this.Repeater1.Items)
        {
            CheckBox cb = r.FindControl("CheckBox1") as CheckBox;       // 获得复选框控件的引用
            HiddenField hf = r.FindControl("Hfield") as HiddenField;          // 获得隐藏控件的引用

            if (cb.Checked == true)
            {
                id_table += hf.Value + ",";
            }

        }





原创粉丝点击