C# – put HTML code in label to display in the page


ASP.NET with C#:
I have a web page which is intended to be a help page. Actually I am using a treeview component, and when someone clicks on a node a label on the page will change text by reading it from text file.

what I want is to put some images in the help so a .txt file will not be suitable. So I may use a .html file instead.

How to read such a .html file and display it in my page? May I replace the label with some thing else or what?

Best Solution

Use ASP.NET Literal control instead. The Literal control is used to display text on a page. The text is programmable.

Note: This control does not let you apply styles to its content!

<asp:Literal />