displaying the HTML code in HTML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Astra

    displaying the HTML code in HTML

    Hi All

    Bit of a dilemma here.

    I'm doing a content management system, whereby the user can enter the HTML
    code for a currency symbol, eg £ for £.

    My problem is that when I bring this data backup, say they want to edit the
    settings, then my ASP/HTML page is rendering the HTML code, eg £, rather
    than showing the original value, eg £.

    If for example I put a space between the '&' and the 'pound;', eg & pound;
    then this will cause me problems because the user will think that they have
    to a put a space in or they file it with the space, which means the HTML
    code won't work any more.

    Is there a way round this?

    Rgds

    Robbie



  • Bob Barrows [MVP]

    #2
    Re: displaying the HTML code in HTML

    Astra wrote:[color=blue]
    > Hi All
    >
    > Bit of a dilemma here.
    >
    > I'm doing a content management system, whereby the user can enter the
    > HTML code for a currency symbol, eg £ for £.
    >
    > My problem is that when I bring this data backup, say they want to
    > edit the settings, then my ASP/HTML page is rendering the HTML code,
    > eg £, rather than showing the original value, eg £.
    >
    > If for example I put a space between the '&' and the 'pound;', eg &
    > pound; then this will cause me problems because the user will think
    > that they have to a put a space in or they file it with the space,
    > which means the HTML code won't work any more.
    >
    > Is there a way round this?
    >
    > Rgds
    >
    > Robbie[/color]

    Use Server.HTMLEnco de(string_conta ining_named_ent ities) to write it to the
    page.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Comment

    • Brian Staff

      #3
      Re: displaying the HTML code in HTML

      If your client is IE then try surrounding the HTML code with a <xmp> structure

      Brian

      Comment

      Working...