Results 1 to 2 of 2

Thread: converting the content of a textbox to html?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    converting the content of a textbox to html?

    I want all the returns (vbcrlf's) and the white spaces to show in HTML. I have two solutions:
    1) I used the <pre> tag
    2) I replaced vbCrLf's with <br> and the spaces with & nbsp; when converting to HTML

    now I have a problem with each. First of all, isn't there a better way to convert the content of a textbox to HTML? I thought replacing all the returns with <br> and replacing double splaces with two nbsp's might be kinda stupid, so I thought I should use <pre>, but my problem with <pre> is that if I have a long line of text, it doesnt let that text wrap in a tableCell. I tried <Pre Wrap> also, but it didnt work....

    so can someone tell me about converting the textbox content to html, and also tell me how can I make the content wrap when I'm using the <pre> tag (I enclosed the content of a tableCell in <pre>)
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Look up HTMLEncode method. That will solve the whitespace problem. The other problem about the new lines, check out here:
    http://www.vbforums.com/showthread.p...hreadid=252850

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