private void LoadLocations() { rptLocations.DataSource = oSolaris.GetSVELocations(intID); rptLocations.DataBind(); lblLocations.Visible = (rptLocations.Items.Count == 0); foreach (RepeaterItem ri in rptLocations.Items) { ((ImageButton)ri.FindControl("btnDeleteLocation")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this location?');"); } }