foreach (RepeaterItem item in rpt1.Items)
{
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
CheckBox chk = (CheckBox)item.FindControl("chk_att");
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
if (chk.Checked == true)
{
st = "Update tbl_member set Status='Attended' where MemberID=" + hf_id.Value + "";
x = db.ExeQuery(st);
if (x > 0)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "", false);
fillrpt();
}
if (chk.Checked == false)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "", false);
}
}
Prasham SabadraPosted May 17, 2015, 1:05 AM
I guess problem is, you are calling fillrpt() method from foreach loop. This makes changes in items collection.
I would say rather you maintain a flag and after for each loop executed then call fillrpt().
akshay rasalakarPosted May 17, 2015, 1:58 AM