Reputation: 69
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 é or é.
If I do something like
button1.text = server.htmlencode("Test é")
then it displays Test é in the button text, i.e. Test &#233; in the HTML source.
How do i solve this problem?
Upvotes: 2
Views: 1293
Reputation: 503
You should be able to set the text without encoding anything. You can try to set globalization setting in web.config inside system.web as follows(Not sure if ISO-8859-1 is the correct encoding for french):
<globalization uiCulture="fr-FR" culture="fr-FR" enableClientBasedCulture="true" responseEncoding="ISO-8859-1" fileEncoding="ISO-8859-1" />
Upvotes: 1