Monday, March 26, 2012

text formatting problem

hi guys,
I realized that whenever the text content of a database is loaded, its formatting (like paragraphing and alignment) is lost! How can I preserve these formattings?

cheersassign the output of the field into a variable (like: strFieldResults)

then, do a replace function on the contents:

strFieldResults=strFieldResults.Replace(vbcrlf, "<br>")

Each line feed separation is stored as a 'vbcrlf' -- - the browser doesn't understand that, so you need to replace these with the HTML LINE BREAK tag, so the browser will understand them.
ic...thx
hi augustwind,
I've tried the code you've given me but it doesn't seems to work. Instead of giving me a line break, it simply inserts a space in between the paragraphs. Do u have any working example of the code which i can reference to?
Use a Css Style sheet and set all your objects to the style you want.

like

.button{background-color: #000099; }

and then in your webform set button1's cssclass to button.

hope that helps
~
hi sausykat,
think you've misunderstood my question. My problem is that whenever the content from my database is loaded, the text's formatting is always lost. So I was asking how can I retain those formattings.

But however, you brought out an interesting point about using the css style sheet to customise the object's style--something which I didn't know how to use either.
So may I ask you where can I learn more about using css style sheet? Do you have a good tutorial for it or something?

Thanks for your help.
Most of what i've learned so far on style sheets are from the MSDN library and different forums i've jumped on.

0 comments:

Post a Comment