I need to handle the Command event for an ImageButton web control on an ASPX page in a VB.NET project.
My Imagebutton is being instantiated and added to a place holder control's collection. How can I tell VB which procedure will handle the event?
I have tried using the AddHandler but my popup list of event objects only includes those objects that exist at design time. I have tried refering to my newly created image button anyway, and get no error when the code runs, but it doesn't fire my procedure when it should:
VB Code:
' Add Image Button ibnConfirm = New ImageButton ibnConfirm.ImageUrl = "Confirm16.ico" ibnConfirm.CommandName = "Confirm" ibnConfirm.CommandArgument = e.Item.DataItem("pk_Quotation_in") ibnConfirm.ToolTip = "Confirm Quotation" AddHandler ibnConfirm.Command, AddressOf ibnConfirm_Command ' Add to place holder collection plhConfirm.Controls.Add(ibnConfirm)
My procedure to handle the Command Event:
VB Code:
Private Sub ibnConfirm_Command(ByVal sender As Object, ByVal e As CommandEventArgs) End Sub





Reply With Quote