On a webform I am creating an array of imagebuttons that holds different images collected from a directory. How can I catch the click event from one of these imagebuttons and store the name of the image before returning?
Below is the code to create them. Ideas/CodeSnippets on how to register event and catch the buttonclick would be appreciated !
Dim Currentfile As String
Dim xx As String
Dim Ff() As String
Dim i As String
iPanel = -1
For Each Currentfile In Directory.GetFiles(Session("imageDir")+ "images\")
Ff = Split(Currentfile, "\")
Currentfile = Ff(Ff.Length - 1)
xx = Mid(Currentfile, Currentfile.Length - 3, 4)
If xx = ".jpg" Or xx = ".gif" Then
iPanel = iPanel + 1
Pics(iPanel) = New ImageButton
Pics(iPanel).ImageUrl = "images\" + Currentfile
Pics(iPanel).AlternateText = Currentfile