HTML Text encoding of web controls

Discussion in 'ASP .Net Web Controls' started by Guogang, Jan 8, 2004.

  1. Guogang

    Guogang Guest

    I find that the encoding of web control is inconsistent. Some controls will
    do an HTML encoding on the text, some don't.

    Say, I want to show the string "<script> alter("test") <script>". For a
    "BoundColumn" used in DataGrid, I get an alert box instead of the string.
    But for "TextBox" control, it is encoded correctly.

    Is there a general rule, or documentation of which controls will do HTML
    encoding automatically, which don't?

    Thanks,
    Guogang
    Guogang, Jan 8, 2004
    #1
    1. Advertising

  2. Guogang

    Felix Wang Guest

    Are you the former TL of GTEC DSV?

    Please ignore this if not...

    --
    Regards,

    Felix Wang

    "Guogang" <nospam@no_such_domain.com> wrote in message
    news:...
    > I find that the encoding of web control is inconsistent. Some controls

    will
    > do an HTML encoding on the text, some don't.
    >
    > Say, I want to show the string "<script> alter("test") <script>". For a
    > "BoundColumn" used in DataGrid, I get an alert box instead of the string.
    > But for "TextBox" control, it is encoded correctly.
    >
    > Is there a general rule, or documentation of which controls will do HTML
    > encoding automatically, which don't?
    >
    > Thanks,
    > Guogang
    >
    >
    Felix Wang, Jan 9, 2004
    #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. Nathan Sokalski
    Replies:
    5
    Views:
    1,001
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  2. Nathan Sokalski
    Replies:
    4
    Views:
    280
    Nathan Sokalski
    Dec 21, 2006
  3. Guogang

    HTML Text encoding of web controls

    Guogang, Jan 8, 2004, in forum: ASP .Net Security
    Replies:
    1
    Views:
    173
    Felix Wang
    Jan 9, 2004
  4. Nathan Sokalski
    Replies:
    4
    Views:
    316
    Nathan Sokalski
    Dec 21, 2006
  5. Replies:
    2
    Views:
    363
Loading...

Share This Page