Professional Web Applications Themes

Creating a "translate" function in ASP.NET, streaming in HTML from the web? - ASP.NET General

I'm transitioning from ASP development, please excuse these basic questions. One thing I did often in ASP was create a "translate" function to render one string to another, strip out excess carriage returns, etc. I want to do the same thing in ASP.NET. I have a mail component that will accept HTML, but it requires all HTML to be listed on a single line. It takes the syntax: msgObj.BodyParts.Add(" <html markup here> "), BodyPartFormat.HTML) Can someone point me to how I might translate a string with carriage returns/newlines into a single unbroken line? How about if I wanted to translate ...

  1. #1

    Default Creating a "translate" function in ASP.NET, streaming in HTML from the web?

    I'm transitioning from ASP development, please excuse
    these basic questions. One thing I did often in ASP was
    create a "translate" function to render one string to
    another, strip out excess carriage returns, etc.

    I want to do the same thing in ASP.NET. I have a mail
    component that will accept HTML, but it requires all HTML
    to be listed on a single line. It takes the syntax:

    msgObj.BodyParts.Add(" <html markup here> "),
    BodyPartFormat.HTML)

    Can someone point me to how I might translate a string
    with carriage returns/newlines into a single unbroken
    line? How about if I wanted to translate one character to
    another?

    Best would be if ASP.NET would actually visit a live page
    on the web, strip out the HTML it needs, and embed it in
    the string above as a single line.

    Thanks in advance for any pointers or resources you might
    be able to provide.

    -KF
    kennethfine Guest

  2. #2

    Default Re: Creating a "translate" function in ASP.NET, streaming in HTML from the web?

    I bet your mail component will accept a variable which contains carriage
    returns.

    But you should look at the methods of the System.String class. In
    particular,

    Dim x as String = "something with CR and/or LF in it"
    Dim stripped as String = x.Replace(ControlChars.vbCr, "
    ").Replace(ControlChars.vbLf, " ")

    Note I'm replacing with a space, so that "A<CrLf>B" doesn't become "AB".

    --
    John Saunders
    Internet Engineer
    [email]john.saunderssurfcontrol.com[/email]


    "kennethfine" <kennethfinehotmail.com> wrote in message
    news:065901c35161$7c0ead00$a101280aphx.gbl...
    > I'm transitioning from ASP development, please excuse
    > these basic questions. One thing I did often in ASP was
    > create a "translate" function to render one string to
    > another, strip out excess carriage returns, etc.
    >
    > I want to do the same thing in ASP.NET. I have a mail
    > component that will accept HTML, but it requires all HTML
    > to be listed on a single line. It takes the syntax:
    >
    > msgObj.BodyParts.Add(" <html markup here> "),
    > BodyPartFormat.HTML)
    >
    > Can someone point me to how I might translate a string
    > with carriage returns/newlines into a single unbroken
    > line? How about if I wanted to translate one character to
    > another?
    >
    > Best would be if ASP.NET would actually visit a live page
    > on the web, strip out the HTML it needs, and embed it in
    > the string above as a single line.
    >
    > Thanks in advance for any pointers or resources you might
    > be able to provide.
    >
    > -KF

    John Saunders Guest

Similar Threads

  1. "Simple" video streaming
    By Tsquared in forum Macromedia Flash Flashcom
    Replies: 11
    Last Post: December 1st, 01:31 PM
  2. ListContains function sees "10" as "1"
    By blcott in forum Macromedia ColdFusion
    Replies: 1
    Last Post: May 1st, 12:26 PM
  3. CFINPUT type="radio" w/ "value" requires "label"
    By Iceborer in forum Macromedia ColdFusion
    Replies: 2
    Last Post: February 21st, 06:16 PM
  4. "Error Creating Control" and "Cast from String"
    By Lisa in forum ASP.NET Building Controls
    Replies: 1
    Last Post: August 14th, 01:53 PM
  5. "Start" "Program" "Menu" list is empty
    By Pete in forum Windows XP/2000/ME
    Replies: 2
    Last Post: July 10th, 10:42 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139