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

Matt Warden mwarden at gmail.com
Tue Sep 5 12:47:34 CDT 2006

On 9/5/06, Chris at globet.com <Chris at globet.com> wrote:
> All
> Can anyone tell me why the output from the following is displayed as
> "&#917;&#955;&#955;&#951;&#957;&#953;&#954;&#940;" rather than the
> desired characters? I cannot find anything in the MSDN documentation
> that suggest why this would happen. Any feedback gratefully received!
> DropDownList languageDropDownList = new DropDownList();
> this.languageDropDownList.Items.Add(new
> ListItem("&#917;&#955;&#955;&#951;&#957;&#953;&#954;&#940;", "gr"));


I am not a .NET guy, but nothing I can find in the docs suggests that
the string passed to the constructor will be interpreted as markup. I
suspect it is simply a string of characters. If they are characters
you can't figure out how to type or otherwise can't declare them
literally, you will need to represent them another way. Most languages
have something like chr(10) and such, to convert from ascii (or other)
code to the character.

Matt Warden
Cleveland, OH, USA

This email proudly and graciously contributes to entropy.

More information about the thelist mailing list