//To detect the Repeater item on button click clicked on ImageButton close = (ImageButton)sender; RepeaterItem gvRow = (RepeaterItem)close.NamingContainer; String URL = ((HtmlInputHidden)gvRow.FindControl("Text1")).Value;//To delete row from table in c# if datakey is equal to the column value in table DataSet ds_cart = (DataSet)(Session["TempCart"]); String[] arr = e.CommandArgument.ToString().Split(','); foreach (DataRow row in ds_cart.Tables[0].Rows) { if (row["OrderID"].ToString() == arr[0].ToString()) { row.Delete(); break; } }