protected void btnLock_Click(object sender, EventArgs e) { //Get Ids string[] IDs = hdnFldSelectedValues.Value.Trim().Split('|'); //Code for deleting items foreach (string Item in IDs) { try { int id = int.Parse(Item.ToString()); string status = "0"; int i = banner_obj.UpdateStatus(id, status); FillDataInGrid(); } catch (InvalidOperationException ef) { ef.ToString(); } } }