Question Silverlight textbox linebreaks

gchq

Well-known member
Joined
Dec 14, 2007
Messages
168
Programming Experience
10+
Hi there

In asp.net if text from a multiline textbox was being sent via email I just used .Replace(Environment.NewLine, "<br/>") and the HTML email was formatted (apart from Notes that insists upon <br/> being <br>, but that's another soapbox, another time..


With Silverlight this doesn't work - I've also tried to replace "\r" and "\r\n" but still it won't format.

Anyone any ideas?

Oh - VS2010 Framework 4.0 Server 2008 R2

Thanks
 
Sorted

VB.NET:
Dim regex As New System.Text.RegularExpressions.Regex("\r(?!\n)|(?<!\r)\n")
        vContent += regex.Replace(TextBox3.Text, "<br/>")
 
Back
Top