【问题标题】:Assign html value to cell将 html 值分配给单元格
【发布时间】:2018-08-05 21:22:01
【问题描述】:

我正在尝试将引导按钮动态分配给我的 ASP.Net 项目中的表格单元格,如下所示:

cellN.InnerText = "11";
row.Cells.Add(cellN);
cellDomain.InnerText = "www.google.com";
row.Cells.Add(cellDomain);
cellIp.InnerText = "192.168.1.1";
row.Cells.Add(cellIp);
cellPorts.InnerHtml = "< button type = \"button\" class=\"btn btn-sm btn-port-info btn-danger\">80</button>";
row.Cells.Add(cellPorts);
MainTable.Rows.Add(row);

但它在输出中显示为文本:

在这种情况下我错过了什么?

【问题讨论】:

  • 天哪,很抱歉,因为我连续工作了这么多小时

标签: c# html asp.net twitter-bootstrap


【解决方案1】:

&lt;button 之间不应有空格。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-23
    • 2020-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多