[thelist] .NET [C#], DropDownList, HTMLEncode

Matt Warden mwarden at gmail.com
Thu Sep 7 08:05:00 CDT 2006

On 9/7/06, Chris at globet.com <Chris at globet.com> wrote:
> > The thought is that it is *not* being treated as if it were
> > HTML-encoded. It is being treated as a literal string. So, if
> > you type "&amp;", you will get "&amp;" just as if you had
> > typed "asdf" and got "asdf".
> To clarify: the input string *is* "&#241;" the ouput string *is*
> "&amp;#241;". What I require is that the input string *should be*
> "&#241;" and the output string *should be* "&#241;". Hence my belief
> that somewhere in the process of assigning the string value to a
> DropDownList item via a ListItem object, an HTML encoding method is
> being executed on the string.

Oh, I see. This is not at all what I thought you were saying. Then, my
searches confirm the source of your confusion -- as far as I can tell,
the string should not be HTML encoded. There is no mention in the docs
I can find that suggests that's the way it should be handled.

Wish I could be more helpful.

Matt Warden
Cleveland, OH, USA

This email proudly and graciously contributes to entropy.

More information about the thelist mailing list