Results 1 to 4 of 4

Thread: Labels can't multiline... what's the deal?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    14

    Thumbs down Labels can't multiline... what's the deal?

    Apparently, the Web Forms Label Control can't recognize a carriage return / line feed and handle it properly... am I going to have to seek out a third party control for this? If so, any recommendations?

  2. #2
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774

    Re: Labels can't multiline... what's the deal?

    Originally posted by kcornell
    Apparently, the Web Forms Label Control can't recognize a carriage return / line feed and handle it properly... am I going to have to seek out a third party control for this? If so, any recommendations?
    Labels can handle multi-lines but a web form requires HTML. Replace the vbCrLf with <br> and your all set.

    John

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    14
    Thanks for the info (new to ASP here). What I was doing was changing a label's text to a textbox's text when a button was pushed, I just used a run-of-the-mill ReplaceString function to find all the vbCrLf's and put in "<br>"s and it worked like a charm.

  4. #4
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774
    Glad it worked.

    You can also use the built-in Replace function/method. All Strings have it by default.

    MyLabel.Text = MyTextBox.Text.Replace(vbCrLf,"<br>")

    - or -

    MyTextBox.Text = MyLabel.Text.Replace("<br>",vbCrLf)


    John

Posting Permissions

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



Click Here to Expand Forum to Full Width