DataGrid doesn't do HTML entity encoding.

Discussion in 'ASP .Net Datagrid Control' started by Chris Mumford, Mar 20, 2005.

  1. I have a DataGrid bound to a table where one of the strings is "<Unknown>".
    When this is sent out via the DataGrid control as HTML it is not encoded and
    therefore it looks like a tag in the HTML stream. What I would expect is
    "&lt;Unknown&gt;". Does anybody know how to make this happen?
    Chris Mumford, Mar 20, 2005
    #1
    1. Advertising

  2. Chris Mumford

    Elton Wang Guest

    You can use

    String.Replace("<","&lt;").Replace(">","&gt;")

    HTH

    Elton Wang


    >-----Original Message-----
    >I have a DataGrid bound to a table where one of the

    strings is "<Unknown>".
    >When this is sent out via the DataGrid control as HTML it

    is not encoded and
    >therefore it looks like a tag in the HTML stream. What I

    would expect is
    >"<Unknown>". Does anybody know how to make this happen?
    >
    >
    >.
    >
    Elton Wang, Mar 20, 2005
    #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. Chris Mumford

    DataGrid doesn't do entity encoding

    Chris Mumford, Mar 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    318
    Chris Mumford
    Mar 20, 2005
  2. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,590
    Jukka K. Korpela
    Feb 24, 2007
  3. markla
    Replies:
    1
    Views:
    531
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    2,672
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,173
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page