Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I've been searching the net for days for a way to store and view (retrieve) formatted documents.

It was my understanding that one could:

A: store a formatted document (With pure html like you get from copying gmail text) in sql server (a datatype of 'Text').

B: then output it again to a label or textbox and it would have the same formatting (Bold, carriage returns, etc).


I've accomplished part A, (when I hover over the field in SSMS, it shows at least the spacing and line skips that match the original doc) but text shows up in my controls as one fluid line of plain text, even with the textbox set to multiline. Labels populate no better.

I'm using C# asp.net in Visual Studio with the 2.0 framework

Is there an easy way to do this? Thanks in advance!
Posted

Brian Fay wrote:
B: then output it again to a label or textbox and it would have the same formatting (Bold, carriage returns, etc).


No, you'd use a Literal control to do that.
 
Share this answer
 
Comments
Gideon A Brits 24-Jan-13 9:09am    
In order for images to display properly in this manner you must remember to include the full path for the image including the "http://"

<img src="http://www.mydomain.com/MyFolder/MyImage.png" />
I will need to familiarize myself with the Literal Control. Any hints on how to use it. I'll look it up in the mean time.
 
Share this answer
 
Posted 19 hours ago
Christian had it right! Thanks!

I looked up 'literal control' and that was all I needed:

http://blogs.techrepublic.com.com/programming-and-development/?p=618
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900