troubleshooting Question

create click event on imane button in asp

Avatar of pamela rizk
pamela rizkFlag for Lebanon asked on
8 Comments1 Solution145 ViewsLast Modified:
dear all

i created an image buton programatically in asp net
below is the code:
  Dim m_htmltable As New HtmlTable
        Dim m_htmlRow As New HtmlTableRow
        Dim m_htmlcell As New HtmlTableCell
        m_htmlcell.Attributes.Add("width", "auto")
        m_htmlcell.Attributes.Add("height", "22px")
        m_htmlcell.Attributes.Add("white-space", "nowrap")
        m_htmlcell.Attributes.Add("class", "textBoxStyle_NoBorder")
        m_htmlcell.Attributes.Add("text-align", "center")
        m_htmlcell.BgColor = "#ECF5FF"

        Dim createDiv As New System.Web.UI.HtmlControls.HtmlGenericControl("DIV") 'create div element with the below styles:Style = "display: inline-block ; white-space: nowrap;"
        createDiv.ID = "createDiv"
        createDiv.Style("display") = "inline-block"
        createDiv.Style("white-space") = "nowrap"
        Dim img As New ImageButton()
        img.ImageUrl = "../../Images/NewIcons/deleteline_Dis_Icon.png"
        img.CommandName = "image_clicked"
        img.CommandArgument = m_htmlcell & ";" & FileNat & ";" & FileNumber & ";" & FileName
        img.Width = "15"
        img.Height = "15"
        img.Attributes("display") = "inline"
        img.Attributes("vertical-align") = "middle"
        img.Attributes("cursor") = "pointer"
        img.Attributes("vertical-align") = "middle"
        AddHandler img.Command, AddressOf img_Click
        Dim CellNbre As String = m_htmlRow.Cells.Count
        Dim File_Link As New HyperLink
        File_Link.Target = "_blank"
        File_Link.ForeColor = System.Drawing.Color.Black
        File_Link.Text = FileName.Replace(" ", "")
        File_Link.NavigateUrl = FileLink

        m_htmlcell.Controls.Add(img) '// append DIV to the table cell
 Protected Sub img_Click(ByVal sender As Object, ByVal e As CommandEventArgs)
       m_htmlcell.Style("display") = "none"

i need on image click to hide the the cell where the image is created
how to do that ?
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros