private void LoopRepeater() { DataSet ds = oHoliday.Gets(0); DataView dv = ds.Tables[0].DefaultView; if (Request.QueryString["sort"] != null) { dv.Sort = Request.QueryString["sort"].ToString(); } rptView.DataSource = dv; rptView.DataBind(); foreach (RepeaterItem ri in rptView.Items) { ImageButton oDelete = (ImageButton)ri.FindControl("btnDelete"); oDelete.Attributes.Add("onClick", "return confirm('Are you sure you want to delete this holiday?');"); ImageButton oEnable = (ImageButton)ri.FindControl("btnEnable"); if (oEnable.ImageUrl == "images/enabled.gif") { oEnable.ToolTip = "Click to disable"; oEnable.Attributes.Add("onClick", "return confirm('Are you sure you want to disable this holiday?');"); } else { oEnable.ToolTip = "Click to enable"; } } }