R
rotomd
The problem is pretty simple.. I want to create a dynamic LinkButton
and add an event handler. Here's my code:
[vb]
Protected WithEvents oLinkButton as linkbutton
Private Sub populateForm()
dim oRow as tablerow
dim oCell as tablecell
dim oDate as datetime
oCell = new tablecell
oLinkButton = new LinkButton
oLinkButton.text = "Delete"
oLinkButton.id = "lbDel"
AddHandler oLinkButton.Click, New System.EventHandler(AddressOf
delTid)
oCell.Controls.add(oLinkButton)
oRow.cells.add(oCell)
tidTable.rows.add(oRow)
End Sub
Private sub delTid(byVal sender As Object, byVal e As System.EventArgs)
handles oLinkButton.Click
response.write ("DELETE Clicked")
End Sub
[end code]
The page renders fine, no errors. Yet when I click on the Delete link,
it posts back, but never writes hits the delTid sub. Any help would be
greatly appreciated. Thanks!
-mike
and add an event handler. Here's my code:
[vb]
Protected WithEvents oLinkButton as linkbutton
Private Sub populateForm()
dim oRow as tablerow
dim oCell as tablecell
dim oDate as datetime
oCell = new tablecell
oLinkButton = new LinkButton
oLinkButton.text = "Delete"
oLinkButton.id = "lbDel"
AddHandler oLinkButton.Click, New System.EventHandler(AddressOf
delTid)
oCell.Controls.add(oLinkButton)
oRow.cells.add(oCell)
tidTable.rows.add(oRow)
End Sub
Private sub delTid(byVal sender As Object, byVal e As System.EventArgs)
handles oLinkButton.Click
response.write ("DELETE Clicked")
End Sub
[end code]
The page renders fine, no errors. Yet when I click on the Delete link,
it posts back, but never writes hits the delTid sub. Any help would be
greatly appreciated. Thanks!
-mike