Results 1 to 2 of 2

Thread: Silverlight textbox linebreaks

  1. #1
    gchq's Avatar
    gchq is offline VB.NET Forum Genius
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2007
    Posts
    168
    Reputation
    118

    Silverlight textbox linebreaks

    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

  2. #2
    gchq's Avatar
    gchq is offline VB.NET Forum Genius
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2007
    Posts
    168
    Reputation
    118

    Sorted

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •