Solved

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

Posted on 2006-10-20
7
199 Views
Last Modified: 2008-02-26
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
0
Comment
Question by:mousemat24
  • 3
  • 3
7 Comments
 
LVL 6

Assisted Solution

by:apb2
apb2 earned 250 total points
ID: 17772855
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
 
LVL 20

Accepted Solution

by:
REA_ANDREW earned 250 total points
ID: 17772856
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
 

Author Comment

by:mousemat24
ID: 17773963
I've ended up using a literal control, is that ok?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 17773979
as long as you set the InnerHtml of a control which has InnerHtml. Yes that is fine.
:-)

Andrew
0
 

Author Comment

by:mousemat24
ID: 17774286
dont understand Andrew, I'm finding a literal control takes care of that automatically. Strange, but it works ok
0
 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 17774293
so have you got your solution now?
0
 

Author Comment

by:mousemat24
ID: 17774318
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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now