473,800 Members | 3,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying html stored in DB

I am writing a web application using C#. I've come to the point that I need
to display some html text that is stored in a database. Is there a server
side control that I can use to show the html? In other words, read the data,
then set the Text property (or something else) and it displays in the window
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus
Aug 18 '06 #1
5 1543
How about adding the markup into a LiteralControl, which you can then hang on
a Placeholder control on the page?

http://msdn.microsoft.com/library/de...classtopic.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Rik Brooks" wrote:
I am writing a web application using C#. I've come to the point that I need
to display some html text that is stored in a database. Is there a server
side control that I can use to show the html? In other words, read the data,
then set the Text property (or something else) and it displays in the window
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus

Aug 18 '06 #2
Oh Gawd I wish I understood what you just said.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus


"Peter Bromberg [C# MVP]" wrote:
How about adding the markup into a LiteralControl, which you can then hang on
a Placeholder control on the page?

http://msdn.microsoft.com/library/de...classtopic.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Rik Brooks" wrote:
I am writing a web application using C#. I've come to the point that I need
to display some html text that is stored in a database. Is there a server
side control that I can use to show the html? In other words, read the data,
then set the Text property (or something else) and it displays in the window
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus
Aug 18 '06 #3
OK, look:

1) Drag a Placeholder Control onto your page where you want the HTML to
display.
2) Get the HTML Out of your database, let's say its in a string variable
"strContent ".
3)

HtmlGenericCont rol ctl = new HtmlGenericCont rol(strContent) ;
Placeholder1.Co ntrols.Add(ctl) ;

That's it. In VB.NET:

Dim ctl as New HtmlGenericCont rol(strContent)
Placeholder1.Co ntrols.Add(ctl)
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Rik Brooks" wrote:
Oh Gawd I wish I understood what you just said.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus


"Peter Bromberg [C# MVP]" wrote:
How about adding the markup into a LiteralControl, which you can then hang on
a Placeholder control on the page?

http://msdn.microsoft.com/library/de...classtopic.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Rik Brooks" wrote:
I am writing a web application using C#. I've come to the point that I need
to display some html text that is stored in a database. Is there a server
side control that I can use to show the html? In other words, read the data,
then set the Text property (or something else) and it displays in the window
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.
>
Animadverto est verus
>
>
Aug 18 '06 #4
Thank you so much for your patience, Peter. I copied and pasted exactly and
my page is just displaying nothing at all. Blank
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus


"Peter Bromberg [C# MVP]" wrote:
OK, look:

1) Drag a Placeholder Control onto your page where you want the HTML to
display.
2) Get the HTML Out of your database, let's say its in a string variable
"strContent ".
3)

HtmlGenericCont rol ctl = new HtmlGenericCont rol(strContent) ;
Placeholder1.Co ntrols.Add(ctl) ;

That's it. In VB.NET:

Dim ctl as New HtmlGenericCont rol(strContent)
Placeholder1.Co ntrols.Add(ctl)
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Rik Brooks" wrote:
Oh Gawd I wish I understood what you just said.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus


"Peter Bromberg [C# MVP]" wrote:
How about adding the markup into a LiteralControl, which you can then hang on
a Placeholder control on the page?
>
http://msdn.microsoft.com/library/de...classtopic.asp
>
Peter
>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
>
>
>
>
"Rik Brooks" wrote:
>
I am writing a web application using C#. I've come to the point that I need
to display some html text that is stored in a database. Is there a server
side control that I can use to show the html? In other words, read the data,
then set the Text property (or something else) and it displays in the window
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus
Aug 18 '06 #5
Ohhhh Peter, I'm so close. Now I get something. Here's my code:

// htmlData is read from db - for our test it is:
//this is <strong>a test </strongof the html stuff
// I know this is true cuz I used the debugger and peeked at it.

HtmlGenericCont rol ctl = new HtmlGenericCont rol(htmlData);
PlaceHolderText .Controls.Add(c tl);

.... and Peter, here is what is shown on my screen:

a test of the html stuff>a test of the html stuff>
Even if you can't help me, thanks for what you've done so far, Peter.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus


"Peter Bromberg [C# MVP]" wrote:
OK, look:

1) Drag a Placeholder Control onto your page where you want the HTML to
display.
2) Get the HTML Out of your database, let's say its in a string variable
"strContent ".
3)

HtmlGenericCont rol ctl = new HtmlGenericCont rol(strContent) ;
Placeholder1.Co ntrols.Add(ctl) ;

That's it. In VB.NET:

Dim ctl as New HtmlGenericCont rol(strContent)
Placeholder1.Co ntrols.Add(ctl)
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Rik Brooks" wrote:
Oh Gawd I wish I understood what you just said.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus


"Peter Bromberg [C# MVP]" wrote:
How about adding the markup into a LiteralControl, which you can then hang on
a Placeholder control on the page?
>
http://msdn.microsoft.com/library/de...classtopic.asp
>
Peter
>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
>
>
>
>
"Rik Brooks" wrote:
>
I am writing a web application using C#. I've come to the point that I need
to display some html text that is stored in a database. Is there a server
side control that I can use to show the html? In other words, read the data,
then set the Text property (or something else) and it displays in the window
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus
Aug 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1391
by: Fuzzyman | last post by:
Does anyone know of an 'easy' way of displaying HTML from python - preferably using standard Tkinter widgets. I've heard that the 'Text' widget can be used to do this - but I don't fancy hand building an HTML parser when it's quite likely someone else has already done it..... I don't *need* eternal links to work, or even stylesheets or tables, but I'd like the other basic tags to work.
1
508
by: Dave Posh | last post by:
I seem to be having a problem displaying time stored in mysql. The format stored in the database is 13:15:05. The database data type is time. I'm using asp vbscript and sql to retrieve the time store in the database. However asp recognizes the data type as date and displays the date instead of the time. If I change the data type in mysql to varchar then asp will display the time correctly, but I cannot do it this way. I want to be able...
2
1372
by: Steve Barnett | last post by:
I have a desktop application that needs to display some summary information. At present I use the RichTextBox control but am unhappy with the results. What I would prefer to do is display an HTML page (complete with graphics) from within my app. The problem is that I have no idea how to go about this and seem to be struggling to find an example that creates the web pages on the fly. Can anyone point me at a tutorial that deals with...
0
1219
by: GM | last post by:
Is it possible to store html stored in a database field and have it maintain the formating? Can you set it to edit the data in a textarea? thanks,
5
7866
by: Tomaz Koritnik | last post by:
Hi I have many short HTML files stored in a binary stream storage to display descriptions for various items in application. HTML would be display inside application using some .NET control or COM control (like Microsoft WebBrowser). For each description there is one HTML file and along description text, it contains links to related information. Clicking related information would for example open new form in application and display some...
0
1300
by: Anthony Harkness-Gripe | last post by:
This is a very simple XSLT, and I'm doing it ways that I've had work before, but it's not displaying HTML. Is there a flaw in my logic? C#: ------------------------------------------------------------------- // context is current HttpContext System.Xml.XmlTextWriter xmlw = new XmlTextWriter(context.Response.Output); // See XML below for CustomDataSet
0
1225
by: psid | last post by:
Displaying HTML/XHTML from source XML file i am having an xml file i want to display the contents of the xml file in a web browser control in winforms however i want to display it as html/xhtml after applying formatting. how can this be done?
2
1030
by: Arinté | last post by:
I have a webpage that I want to have a list of dates and on the right I want to show the blog info associated with that date. That blog could have some html info in it, what would be the best control to use to display that html info?
7
1079
by: GaryDean | last post by:
I have HTML formatted documents stored in a database. I want to display them on a web page. However I see there is no "browser control" in asp (as there is in windows forms). This sounds kind of stupid but is there a control that I can load HTML into to display in a web page? Thanks, Gary
0
9694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9553
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10509
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10039
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7584
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6824
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2953
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.