How to display HTML from a SQL table to a ASPX file?

Hi there

I have a SQL table, one of the columns is a text field, that text field has HTML. How do I get the HTML displayed to the user. I've used a textbox, but that acually display the HTML code.

Hope this makes sense?
Thank you
Mousemat24
mousemat24Asked:
Who is Participating?
 
REA_ANDREWConnect With a Mentor Commented:
yeh create a div

<div id="YourHtmlDiv" runat="server"></div>

then in your code you have to Access the InnerHtml

so.... in C# this would be

YourHtmlDiv.InnerHtml = "<h1>Hello</h1>";
0
 
apb2Connect With a Mentor Commented:
Hi

If you are writing an HTML editor the best way are to use <div> tags this can be set as server control <div id="divHTML" runat="server"></div>

here you'll be able to view the html and also edit it.

http://www.devarticles.com/c/a/HTML/Building-a-WYSIWYG-HTML-Editor-Part-1/

HTH

apb2
0
 
mousemat24Author Commented:
I've ended up using a literal control, is that ok?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
REA_ANDREWCommented:
as long as you set the InnerHtml of a control which has InnerHtml. Yes that is fine.
:-)

Andrew
0
 
mousemat24Author Commented:
dont understand Andrew, I'm finding a literal control takes care of that automatically. Strange, but it works ok
0
 
REA_ANDREWCommented:
so have you got your solution now?
0
 
mousemat24Author Commented:
is, I'm using the literal control, thats before I got any response from you 2. I think I might have to split the points, hope thats ok with you guys?
0
All Courses

From novice to tech pro — start learning today.