Replacing linebreaks with <br>

Discussion in 'ASP .Net' started by Stefan Landgraf, Aug 19, 2003.

  1. Hi there!

    How can i replace linebreaks with <br> in datalist output ?
    Is there a way i can do that in the aspx page itself without having
    to go through the code page?

    Thanks
    Stefan
    Stefan Landgraf, Aug 19, 2003
    #1
    1. Advertising

  2. Stefan,

    Normal functions can be called directly from within your databind
    expressions so you could do it something like this. I haven't tested this
    code so it might have to be modified slightly but I'm pretty confident it
    will work as is:

    <%# CType(DataBinder.Eval(Container,
    "DataItem.MyItem"), String).Replace(VbCrlf, "<br>") %>

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Stefan Landgraf" <> wrote in message
    news:bht8eq$2t5cd$-berlin.de...
    > Hi there!
    >
    > How can i replace linebreaks with <br> in datalist output ?
    > Is there a way i can do that in the aspx page itself without having
    > to go through the code page?
    >
    > Thanks
    > Stefan
    >
    >
    S. Justin Gengo, Aug 19, 2003
    #2
    1. Advertising

  3. thanks, justin. that was what i needed
    Stefan Landgraf, Aug 19, 2003
    #3
    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. Replies:
    2
    Views:
    599
  2. meltedown

    linebreaks in a text area

    meltedown, Oct 20, 2005, in forum: HTML
    Replies:
    3
    Views:
    519
    Mark Parnell
    Oct 20, 2005
  3. michga
    Replies:
    0
    Views:
    449
    michga
    Jun 14, 2006
  4. =?ISO-8859-15?Q?Martin_K=F6rner?=

    email: Content-Disposition and linebreaks with long filenames

    =?ISO-8859-15?Q?Martin_K=F6rner?=, Apr 13, 2005, in forum: Python
    Replies:
    2
    Views:
    3,496
    David Bolen
    Apr 19, 2005
  5. Jean-Paul Calderone

    Re: Telnet linebreaks

    Jean-Paul Calderone, May 25, 2006, in forum: Python
    Replies:
    0
    Views:
    507
    Jean-Paul Calderone
    May 25, 2006
Loading...

Share This Page