Newbie Question

Results 1 to 2 of 2

Thread: Newbie Question

  1. #1
    Join Date
    Dec 1969

    Default Newbie Question

    I have some dynamic table and dynamic ImageButton<BR>Example :<BR>There are 4 table, each ID is "Tbl1", "Tbl2", "Tbl3", and "Tbl4"<BR>There are 4 Image button, each ID is "Img1", "Img2", "Img3", and "Img4".<BR>I want to put "onclick" subroutine to Image button. The subroutine is to make the Table&#039;s visible = false. So if I clicked "Img1", then "Tbl1" visible will be false. <BR>Can anyone tell me how to do this?<BR><BR>Script :<BR>For i = 1 to 4<BR> Img = New ImageButton()<BR> Img.ImageUrl = "Images/Icon.gif"<BR> Img.ID = "Img" & i<BR> AddHandler Img.Click, AddressOf VisibleSub<BR> Tbl = New Table()<BR> Tbl.ID = "Tbl" & i<BR>Next<BR>Sub VisibleSub(Sender as Object,E as ImageClickEventArgs)<BR> &#039;####WHAT SYNTAX DO I HAVE TO WRITE??<BR> &#039;####THANK&#039;S FOR YOUR HELP<BR>End Sub

  2. #2
    Join Date
    Dec 1969

    Default RE: Newbie Question

    The image object that is clicked is in the Sender parameter. You can check properties in the Sender parameter to see if it is the same image. For example, you could do this:<BR><BR>Sub VisibleSub(Sender as Object,E as ImageClickEventArgs)<BR> Dim imgCheck As ImageButton = Sender<BR> If (imgCheck.ID = "Img1") Then<BR> &#039; Process the first image<BR> &#039;...<BR> ElseIf (imgCheck.ID = "Img2") Then<BR>&#039;etc.<BR>End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts