Why if I wrote on a .aspx page (on .NET 3.5) :
<%="Wählen Sie bitte"%>
it prints correctly on my html page :
Wählen Sie bitte
but if I write on a .aspx.cs page somethings like :
mySelectBox.Items.Add(new ListItem("Wählen Sie bitte", ""));
(which is the same string) it prints as option on the select an uncorrectly html :
W&auml;hlen Sie bitte
It does a “decode” of my string. Why? And how can I fix it?
ASP.NET controls already HTML encode the output so you don’t need to do it once again.
Simply: