W
Wade
Hi all,
I am dynamically adding a link button to a page, but for some reason it is
not raising the click event in the code behind. Here are some snippets from
my code -- any help is greatly appreciated:
' declaring variable
Protected WithEvents lbtEquipment As
System.Web.UI.WebControls.LinkButton
...
' setting properties
lbtEquipment = New System.Web.UI.WebControls.LinkButton
lbtEquipment.Text = "New"
lbtEquipment.ID = "lbtEquipment"
lbtEquipment.CssClass = "GridDataEntryNew"
' adding control to table cell
tcNew.Controls.Add(lbtFreeboard)
...
' trying to handle the click event
Private Sub lbtEquipment_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbtEquipment.Click
Try
Response.Write("test")
Catch ex As Exception
End Try
End Sub
I know this is a bit out of context, but hopefully someone can tell me what
I'm missing. I want the linkbutton, which was added to the table cell, to
raise the lbtEquipment_Click event when it's clicked!
Thanks!
Wade
I am dynamically adding a link button to a page, but for some reason it is
not raising the click event in the code behind. Here are some snippets from
my code -- any help is greatly appreciated:
' declaring variable
Protected WithEvents lbtEquipment As
System.Web.UI.WebControls.LinkButton
...
' setting properties
lbtEquipment = New System.Web.UI.WebControls.LinkButton
lbtEquipment.Text = "New"
lbtEquipment.ID = "lbtEquipment"
lbtEquipment.CssClass = "GridDataEntryNew"
' adding control to table cell
tcNew.Controls.Add(lbtFreeboard)
...
' trying to handle the click event
Private Sub lbtEquipment_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbtEquipment.Click
Try
Response.Write("test")
Catch ex As Exception
End Try
End Sub
I know this is a bit out of context, but hopefully someone can tell me what
I'm missing. I want the linkbutton, which was added to the table cell, to
raise the lbtEquipment_Click event when it's clicked!
Thanks!
Wade