0
private void GetGroupListHtml()
{
//...Code omitted
String htmlCode = String.Empty;
foreach (DataRow _DataRow in _DataTable.Rows)
{
htmlCode += @"<div class=""box collapsed-box"">
<div class=""box-header with-border"">
<h3 class=""box-title"">
<asp:Label ID=""groupTitleLabel"" runat=""server"" Text=" +_DataRow["groupName"] + @"""></asp:Label>
</h3>
<div class=""box-tools pull-right"">
<button class=""btn btn-box-tool"" data-widget=""collapse"" data-toggle=""tooltip"" title=""Expand""><i class=""fa fa-plus""></i></button>
</div>
</div>
</div>";
}
}
我想将html代码添加到div。这样做有可能吗?基本上我有一个字符串变量附加的HTML代码。我想在div标签之间转储此代码并将新网页返回给用户。将html代码动态添加到div
<div id="groupListDiv" runat="server"></div>
有没有问题使用div也 – Imad
正确,但我更喜欢使用ASP.NET控件 – Mivaweb
嗨它的工作原理。那么我该如何为htmlCode中的每个按钮编写单击事件。 – RStyle