HTML encoding method?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • matt@mailinator.com

    #1

    HTML encoding method?

    hello,

    i need to do some HTML encoding on some strings. not UrlEncoding, mind
    you, but HTML encoding. ie:

    "&" to "&"
    "<" to "&lt;"

    ....etc. does anyone know of a good way to do this, other than manual
    string replacements? what of decoding back into plain text?


    thanks,
    matt

  • Bob Johnson

    #2
    Re: HTML encoding method?

    HttpServerUtili ty.HtmlEncode() is what you're looking for. Here's MS
    documentation on it:

    http://msdn2.microsoft.com/en-gb/library/w3te6wfz.aspx

    I just googled [.NET + HTMLEncode] and got over 200,000 links on this... the
    above is just one of them

    HTH



    <matt@mailinato r.comwrote in message
    news:1171050927 .250882.317160@ h3g2000cwc.goog legroups.com...
    hello,
    >
    i need to do some HTML encoding on some strings. not UrlEncoding, mind
    you, but HTML encoding. ie:
    >
    "&" to "&amp;"
    "<" to "&lt;"
    >
    ...etc. does anyone know of a good way to do this, other than manual
    string replacements? what of decoding back into plain text?
    >
    >
    thanks,
    matt
    >

    Comment

    Working...