I have a ImageButton instance variable in my custom control I am making. I am a little shaky on how to simply set up it's event handler for it's click event. Coming from C#, I am a little confused as this is in VB.NET.
Snip:
Dim ctrlCloseImage As ImageButton = New ImageButton()
With ctrlCloseImage
.ID = "imgClose"
.ImageUrl = "~/Web/Images/close.gif"
.ToolTip = "Close"
.CssClass = "popup_close_img"
'This is where I left off
AddHandler ctrlCloseImage.Click, AddressOf testSub(ctrlCloseImage, ??)
End With
Me._ctrlCloseImage = ctrlCloseImage
And Then:
Protected Sub testSub(ByVal Sender As Object, ByVal e As ImageClickEventArgs)
Me.Page.Response.Write("Yay, you clicked the image button!")
End Sub
Thanks for any help, and if I am missing anything important code-snip wise please let me know. Again, I am wanting this to fire server side, I am not interested in firing off a javascript function here.