CrLf within codebehind

Posted on 2007-07-26
Last Modified: 2013-11-26
I am having trouble trying to generate a carriage return/ line feed in using vb in codebehind. I have tried the <br> I have tried the vbCrLf and here is my latest:

SchInfo = stockNum & ControlChars.CrLf
SchInfo = SchInfo & Office & ControlChars.CrLf
SchInfo = SchInfo & zip & ControlChars.CrLf
 SchInfo = SchInfo & "-------------"

I am looking to have the information appear on 4 separate lines, instead it is showing up on one long line, ignoring the CrLf. the info is to appear within a cell of a table.

Thank You....
Question by:larrystewart
    LVL 12

    Expert Comment

    LVL 48

    Expert Comment

    try chr(13)
    LVL 96

    Accepted Solution

    What happens when you use the <br /> to insert a hard-break?  Is it that the <td> element has a height specified, and it doesn't grow?

    LVL 6

    Expert Comment


    LVL 12

    Expert Comment

    You could always create a new table in that cell:

    SchInfo = "<table><tr><td>"
    SchInfo = stockNum & "</td></tr><tr><td>"
    SchInfo = SchInfo & Office & "</td></tr><tr><td>"
    SchInfo = SchInfo & zip & "</td></tr><tr><td>"
    SchInfo = SchInfo & "-------------" & "</td></tr></table"

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now