views:

24

answers:

1

I'm pulling data out of a database with a listview on a webpage.

When I was working with my excel source before transferring to database I was told vbcrlf's will automatically get rendered. This is my first app now that all my data is showing without the line breaks and I was told from someone else I'm supposed to have br tags instead of the vbcrlf's.

To avoid any future trouble, do any of the other data controls render vbcrlf's or is this just a listview peculiarity in ASP.net?? If not, how do I make my webpage render the vbcrlf's? If so, whats the simplest way to replace vbcrlf's for br tags in a mysql database? (/w utf8 char set)

Thanks

+1  A: 

That does it

<asp:Label ID="DetailsLabel" runat="server" Text='<%#  Eval("Details").Replace(Environment.NewLine, "<br>") %>' />
Mike