I would like to add a link button control to a table cell, server side. The cell also has text in it, which gets overwritten by the control when I add it. How do I add the control to the cell and have the text remain as well?
//Create a table cell and add text to it
TableCell commentCell = new TableCell();
commentCell.Text = "Text to remain in the cell."
//Create a linkbtn and add it to the table cell
LinkButton lbtnComments = new LinkButton();
lbtnComments.Text = "...";
lbtnComments.Style["float"] = "right";
commentCell.Controls.Add(lbtnComments);
Add your text into LiteralControl :
I would simply add a
Label
before yourLinkButton
: