DataListItem row = (DataListItem)(((ImageButton)e.CommandSource).NamingContainer); ImageButton ImageButton = (ImageButton)DataList1.Items[row.ItemIndex].FindControl("Image1") as ImageButton; Label lblnum = (Label)DataList1.Items[row.ItemIndex].FindControl("lblnum") as Label; AjaxControlToolkit.ModalPopupExtender modpopup = new AjaxControlToolkit.ModalPopupExtender(); modpopup.TargetControlID = "ImageButton"; modpopup.PopupControlID = "pnlDirImages"; modpopup.BackgroundCssClass = "modalBackground"; modpopup.CancelControlID = "btnclose"; conn.Open(); string strquery = "some query"; SqlDataAdapter da = new SqlDataAdapter(strquery, conn); da.Fill(objds); conn.Close(); if (objds.Tables[0].Rows.Count > 0) { dlImages.DataSource = objds.Tables[0]; dlImages.DataBind(); pnlDirImages.Visible = true; modpopup.Show(); } else { pnlDirImages.Visible = false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)