Warning: explode() expects parameter 2 to be string, array given in /home/linosilv/public_html/blog/wp-content/plugins/cloogooq/cloogooq.php on line 425
ASP.NET – Passing textbox newlines to html breaks | Lino Silva – blog
May 25, 2010 Posted Under: ASP.NET

ASP.NET – Passing textbox newlines to html breaks

I came across this little annoyance today, that newlines in my textboxes were being saved as “\n” instead of “<br/>”, turning out to appear all in the same paragraph on a webpage me and my working group are working on.

To solve this, all it took was a simple:

label = label.replace(\n, “<br/>”);

It is also acceptable Environment.NewLine instead of “\n”.

Hope it helps.

EDIT: Fuck, can’t get to put “<br/>” in the title.

Leave a Reply