How do I get a dynamically created button control to appear in a dynamically
created table cell?
Here's what I've tried:
While objDR1.Read()
Dim objButton As New Button
Dim objTableRow As New TableRow
Dim objTableCell As New TableCell
Dim strURL As String = objDR1("URL").ToString()
objButton.Text = "edit"
objButton.Visible = True
objButton.Width = New Unit(60)
objButton.Height = New Unit(20)
AddHandler objButton.Click, AddressOf DynamicButtonClick
objTableCell.Controls.Add(objButton)
objTableCell.Text = objMember.AuthorizeGetPageRoles(strURL).Replace(", ",
"<br>")
objTableRow.Cells.Add(objTableCell)
objTableCell = New TableCell
objTableCell.Text = objDR1("DisplayName").ToString()
objTableRow.Cells.Add(objTableCell)
objTableCell = New TableCell
objTableCell.Text = strURL
objTableRow.Cells.Add(objTableCell)
tblMenuSecurity.Rows.Add(objTableRow)
End While
This does not work: the buttons do not show up in the table cells (in fact,
they don't show up at all, anywhere).
Ideas?
TIA,
Owen