Friday, March 22, 2013

Format text returning from query having newline character.

Sometime we come across a situation that user enter the data with line breaks into database but when we display that data in page it shows data as a single line without formatting.To solve this situation before showing data we have to convert newline characters with "<br/>"
 

s.Replace(Environment.NewLine, "<br/>")

No comments :

Post a Comment