Hi everyone
I have a question about ASP.net and the database that I am using - this will probably be quite simple to most people but I would be grateful for any help.
I am using a MYSQL database and one of my tables has a LONGTEXT field. I create a query to extract data from this table and bind everything to a datalist (this works fine). However, the problem is that in this field is data that is made up of paragraphs and line spaces. In the MYSQL database it shows that paragraph symbols have been inserted. When the data shows on a ASP.NET page it just shows on one line - without any of the line spaces.
The question: How can I get around this so that data that is displayed from the database will maintain all its line and paragraph formatting when it is displayed on the ASP.NET page.
Any help would be extremely grateful.
Thanks
BBefore you display the string, replace newlines with the <br> tag:
testString = testString.Replace( Environment.NewLine, "<br>" )
Hi Darrell
Thanks for your help - it worked fine. Magic.
Cheers
Blair
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment