Hi,
I create a servercontrol for ASP.Net. For being short and precise I just list the things I do:
(1) Call EnsureChildControls in OnInit
(2) Create a dynamic table in CreateChildControls:
Table aTable = new Table();
aTable.ID = this.ID + "$" + T;
TableRow aRow = new TableRow();
aRow.ID = aTable.ID + "$R" + <COUNTER>.ToString();
TableCell aCell = new TableCell();
createLinkButton(row, col, caption, aCell, aRow.ID);
this.Controls.Add(aTable);
(3) Have a function like:
void aLinkButton_Command(object sender, CommandEventArgs e)
{
// Some stuff
return;
}
(4) Have a function like:
void createLinkButton(int row, int col, string caption, TableCell aCell, string baseID) {
LinkButton lb = new LinkButton();
lb.ID = baseID + "$" + row.ToString() + col.ToString();
lb.Command += new CommandEventHandler(aLinkButton_Command);
lb.Text = caption;
lb.CommandName = "<command>";
aCell.Controls.Add(lb);
return;
}
But: The event is never called. The href is redered for postback, but the wired event never gets triggered.
No ideas anymore :(
Any ideas