title: ASP.NET 4.0 Dropdownlist text coded in Chrome, Firefox
body: <p>I have an asp.net site which was developed with Visual Studio Pro 2010 with a  back-end of Windows Server 2008 R2 with SQL server 2008 R2 and II7 with Framework is 4.0</p>
  
  <p>My Dropdownlist is working good only on IE, but not on chrome and firefox. The items are being displayed with weird characters, I am guessing that the output is encoded, so I just implemented a code to solve the issue but it seems that I am doing something wrong. See below by code.</p>
  
  <p>Also I have tried with the legacy configuration just in case that is causing the problem, So I decided to put the following line on my web.config file.</p>
  
  <p>web.config</p>
  
  <pre><code>&lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/&gt;
  </code></pre>
  
  <p>ASP.NET HTML TAG</p>
  
  <pre><code>&lt;asp:DropDownList ID="JobCategoryList" runat="server"  OnDataBound="SortHTML"&gt;
      &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>Code Behind</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!Page.IsPostBack)
          {
              DisplayCategories();
          }  
  }
  
  private void DisplayCategories()
      {
          _objCategories.getJobCategories();
          JobCategoryList.DataSource =         _objCategories.JobCategoriesDS.Tables["GetJobCategories"];
          JobCategoryList.DataTextField = "CategoryName";
          JobCategoryList.DataValueField = "Id";
          JobCategoryList.DataBind();
      }
  
  protected void SortHTML(object sender, EventArgs e)
      {
          foreach (ListItem item in ((DropDownList)sender).Items)
          {
              item.Text = Server.HtmlDecode(item.Text);
          }
      }
  </code></pre>