Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

Linebreak in asp label

Modified: 2009/01/12 12:00 by jim - Categorized as: ASP.NET, Front-end
An asp:label control does not render "\r\n" correctly. To display text entered in a multiline textbox correctly with a label control use the following code:

lblMessage.Text = tbMessage.Text.Replace("\r\n", "<br />");

 © Evident Interactive BV