这就是我为每个单元格创建一个添加链接按钮的方法。我坚持从表中获取选定的单元格值
int noofquestions = 60;
int k = 1;
for (int i = 1; i <= noofquestions / 5; i++)
{
HtmlTableRow tRow = new HtmlTableRow();
//TableRow tRow = new TableRow();
tblNavigation.Rows.Add(tRow);
for (int j = 1; j <= 5; j++)
{
HtmlTableCell tCell = new HtmlTableCell();
//TableCell tCell = new TableCell();
//tCell.Text = "Row " + i + ", Cell " + j;
tRow.Cells.Add(tCell);
//tCell.InnerText = k.ToString();
LinkButton link = new LinkButton();
//HyperLink link = new HyperLink();
link.Text = k.ToString();
tCell.Controls.Add(link);
k = k + 1;
}