I've reviewed many of the previous posts on this to make sure I'm not doing something wrong but I'm stumped. I am dynamically creating LinkButtons and I'm assigning a generic Click event to them. The event doesn't seem to be firing. I have the code set
in the Page_Init.
My code:
For Each CalendarDay As TableCell In CalendarRow.Cells
Dim DateLink As New LinkButton
JonnyBravoII
Member
43 Points
74 Posts
AddHandler for click event
Apr 30, 2012 09:55 AM|LINK
I've reviewed many of the previous posts on this to make sure I'm not doing something wrong but I'm stumped. I am dynamically creating LinkButtons and I'm assigning a generic Click event to them. The event doesn't seem to be firing. I have the code set in the Page_Init.
My code:
For Each CalendarDay As TableCell In CalendarRow.Cells
Dim DateLink As New LinkButton
Try
AddHandler DateLink.Click, AddressOf dateButton_Click
.......some other code.....
For the dateButton_Click, I just put in a msgbox to see if I'm getting there.
Protected Sub dateButton_Click(sender As Object, e As EventArgs)
MsgBox(sender.ToString)
MsgBox(e.ToString)
End Sub
The event just doesn't fire. Ideas?