Display text with <newline> characters...

Discussion in 'ASP .Net Web Controls' started by TTT, Jun 21, 2006.

  1. TTT

    TTT Guest

    Hi

    When users write a text in a textarea, they hit [ENTER]. So the text is cut
    by <newline> caracters.

    When display this text in a LabelText, i must convert these <newline> in
    <br>. Is there a control to do that?
    Otherwise, what is the best function to parse and convert <newline> tokens
    into <br> balise?

    Thanks
     
    TTT, Jun 21, 2006
    #1
    1. Advertising

  2. Try using the following:


    lblYourLabel.Text.Replace(ControlChars.NewLine, "<br>")


    I used this code in some of my pages, and it worked great. Good Luck!
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "TTT" <> wrote in message
    news:4499ce8a$0$16569$...
    > Hi
    >
    > When users write a text in a textarea, they hit [ENTER]. So the text is
    > cut by <newline> caracters.
    >
    > When display this text in a LabelText, i must convert these <newline> in
    > <br>. Is there a control to do that?
    > Otherwise, what is the best function to parse and convert <newline> tokens
    > into <br> balise?
    >
    > Thanks
    >
     
    Nathan Sokalski, Jun 23, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krzysztof Fink-Finowicki via .NET 247

    Unicode and newline characters in XML text sond via Web Service

    Krzysztof Fink-Finowicki via .NET 247, Oct 17, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    137
    Krzysztof Fink-Finowicki via .NET 247
    Oct 17, 2004
  2. Krzysztof Fink-Finowicki via .NET 247

    Unicode and newline characters in XML text sond via Web Service

    Krzysztof Fink-Finowicki via .NET 247, Oct 31, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    205
    Dan Rogers
    Nov 15, 2004
  3. Krzysztof Fink-Finowicki via .NET 247

    Unicode and newline characters in XML text sond via Web Service

    Krzysztof Fink-Finowicki via .NET 247, Nov 17, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    187
    Krzysztof Fink-Finowicki via .NET 247
    Nov 17, 2004
  4. Krzysztof Fink-Finowicki via .NET 247

    Unicode and newline characters in XML text sond via Web Service

    Krzysztof Fink-Finowicki via .NET 247, Dec 22, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    204
    Dan Rogers
    Jan 4, 2005
  5. Krzysztof Fink-Finowicki via .NET 247

    Unicode and newline characters in XML text sond via Web Service

    Krzysztof Fink-Finowicki via .NET 247, Jan 23, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    134
    Krzysztof Fink-Finowicki via .NET 247
    Jan 23, 2005
Loading...

Share This Page