I need to add button at run time in my table in aspx
table.Append("<table border='1' class='table table-striped' width='450px'>");
table.Append("<tr><th>Facilities</th><th>Size</th><th>InterestRate</th><th>View in Doc</th>");
table.Append("</tr>");
if (dr.HasRows)
{
while (dr.Read())
{
table.Append("<tr >");
table.Append("<td>" + dr[0] + "</td>");
table.Append("<td>" + dr[1] + "</td>");
table.Append("<td>" + dr[2] + "</td>");
table.Append("<td>" + <asp:Button ID = 'btnOpenDoc' runat = 'server' CssClass = 'button rounded' Width = '200px' Text = 'Open Document' OnClick = 'RunPowerShellScript_OnClick()'/> + "</td>");
table.Append("</tr>");
}
}
I'm having issue with this line:
table.Append("<td>" + <asp:Button ID = 'btnOpenDoc' runat = 'server' CssClass = 'button rounded' Width = '200px' Text = 'Open Document' OnClick = 'RunPowerShellScript_OnClick()'/> + "</td>");
tablevariable? Note also you are creating duplicate IDs as well which is a VeryBadThing.