Click here to Skip to main content
11,478,066 members (74,110 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 ASP.NET HTML
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 7-Feb-10 13:07pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Gideon A Brits at 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" />
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 194
1 Richard Deeming 180
2 OriginalGriff 160
3 Sascha Lefèvre 145
4 Tomas Takac 130
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,256
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,305


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 8 Feb 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100