Solved

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

Posted on 2006-10-20
7
200 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.NET e-commerce website 4 59
c# regex: extract & replace text between braces 6 45
How to deploy to IIS 7 on 2008R2 server with DUO 2-step login? 2 37
Syntax error 9 45
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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

17 Experts available now in Live!

Get 1:1 Help Now