Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从动态生成的带有链接的html表中选择单元格_C#_C# 4.0 - Fatal编程技术网

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

C# 如何从动态生成的带有链接的html表中选择单元格,c#,c#-4.0,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(); tblNavigati

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

 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;


        }