如何从带有链接的动态生成的html表中选择单元格

时间:2015-01-02 05:30:04

标签: c# c#-4.0

这就是我为每个单元格创建一个添加链接按钮的方法。我坚持从表中获取选定的单元格值

 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;


        }

0 个答案:

没有答案