views:

83

answers:

0

I need to write out a submit button in ASP.NET so that the button text value is HTML-encoded using the proper HTML entities for the various French characters with accents.

The button is simply declared as

<asp:Button id="button1" runat="server" />

If I do something like

button1.text = "Test é"

then it displays the button text correctly as Test é in the web page, but the HTML source is also Test é, which is not what I need -- I need either &eacute; or &#233;.

If I do something like

button1.text = server.htmlencode("Test é") 

then it displays Test &#233; in the button text, i.e. Test &amp;#233; in the HTML source.

How do i solve this problem?