Why does the stringbuilder render the HTML tags in the webpage?
It ends up looking like this in on the webpage
<b>UserAccountID:</b> 25xxx </br><b>vcAccessNumber:</b> 08505xxxx</br><b>DnisNumber:</b> 08505xxxx</br><b>Description:</b> Samtalsfxxxxx</br>
here is the code
stringBuilder.Append("<div><b>Table name: "+table.TableName +".</b></br> Contains "+table.Columns.Count+" columns and "+ table.Rows.Count+" rows</br>");
stringBuilder.Append("Column names and first row data: </br>");
for (int i = 0; i < table.Columns.Count; i++)
{
stringBuilder.Append("<b>" + table.Columns[i].ColumnName + ":</b> " + table.Rows[0][i] + "</br>");
}
stringBuilder.Append("</div>");
This has nothing to do with the
StringBuilder– it is about how you are writing the string out to the page.In your case, it looks like the string is getting HTML encoded. You need to ensure it is written literally, without any encoding.