I have created a series of buttons in C# and would like to make sure their text, which consists of special characters, is displayed properly in every browser. I tried using HTML characters as text but these were read as a string as opposed to as HTML. How can I do this?
protected void CreateButton()
{
btnSkill = new Button();
btnSkill.Text = "display this German symbol: ä"; // PROBLEM HERE!
}
I am going to have a problem posting my full code since I am importing the text as a string from a Webservice which in turns imports it from a database.
This is the method which generates the buttons' text:
Code:
protected void CreateTblMainSkill()
{
int i = 0;
// Creates a cell with a skill in each row
foreach(object skill in criterium)
{
btnSkill = new Button();
cellSkill = new TableCell();
rowSkill = new TableRow();
btnSkill.ID = Convert.ToString(criterium[i].ID);
btnSkill.Text = criterium[i].Skill; // PROBLEM LIES HERE!!!!!
btnSkill.BackColor = System.Drawing.Color.Transparent;
btnSkill.BorderColor = System.Drawing.Color.Transparent;
cellSkill.Controls.Add(btnSkill);
rowSkill.Controls.Add(cellSkill);
// On button click display side table for desired skill
btnSkill.Click += new EventHandler(btnSkill_CheckedChanged);
// For every skill add rbtn for each ENumGrade
for (int c = 0; c < eNumGradesList.Length; c++)
{
cellRbtn = new TableCell();
rbtnSkill = new RadioButton();
rbtnSkill.ID = Convert.ToString(criterium[i].ID) + "eNumGrade" + c;
rbtnSkill.Checked = false;
rbtnSkill.GroupName = Convert.ToString(criterium[i].Skill);
cellRbtn.Controls.Add(rbtnSkill);
cellRbtn.BorderColor = System.Drawing.Color.Blue;
rowSkill.Controls.Add(cellRbtn);
}
// Add the following rows to the stage
tblMain.Rows.Add(rowSkill);
i++;
}
}
The skill name to be displayed on the button (i.e. criterium[i].Skill) is generated here:
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.