Is it possible in ASP.NET to take a string containing some HTML and make ASP.NET to parse it and create a control for me? For instance:
string rawHTML = "<table><td><td>Cell</td></tr></table>";
HTMLTable table = MagicClass.ParseTable(rawHTML);
I know that this is bad, but I am in an unsuccessful situation, that this is the only way to achieve what I need (since I can not change this code of my colleague).
In addition, I know that LiteralControl allows you to have a control with arbitrary HTML code, but, unfortunately, I need them to be converted to the correct control.
Unfortunately, HTMLTable does not support the InnerHTML property. I need to save the HTML tree exactly as it is, so I cannot put it in a tag <div>.
Thank.
source
share