Convert string to HTML

Discussion in 'ASP .Net' started by Paul Ritchie, Jul 21, 2003.

  1. Paul Ritchie

    Paul Ritchie Guest

    Is there something in .NET that will convert a string so that it can be
    displayed correctly as HTML?

    eg I would like to convert the string "a < b" to "a  b".

    cheers,
    Paul.
    Paul Ritchie, Jul 21, 2003
    #1
    1. Advertising

  2. Hi Paul,

    Try this?

    Server.HtmlEncode("a < b")

    Gives:

    a &lt; b

    Ken
    MVP [ASP.NET]


    "Paul Ritchie" <> wrote in message
    news:...
    Is there something in .NET that will convert a string so that it can be
    displayed correctly as HTML?

    eg I would like to convert the string "a < b" to "a  b".

    cheers,
    Paul.
    Ken Cox [Microsoft MVP], Jul 21, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Cheng[MSFT]

    RE: Convert HTML to XML or Paser HTML

    Steven Cheng[MSFT], Jan 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,452
    George Ter-Saakov
    Feb 12, 2004
  2. Joerg Jooss

    Re: Convert HTML to XML or Paser HTML

    Joerg Jooss, Jan 11, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    548
    Joerg Jooss
    Jan 11, 2004
  3. csgraham74
    Replies:
    2
    Views:
    1,209
    csgraham74
    Sep 19, 2006
  4. ldng
    Replies:
    3
    Views:
    1,782
    Tim Golden
    May 10, 2007
  5. Replies:
    2
    Views:
    168
    John Bokma
    Aug 30, 2013
Loading...

Share This Page