Microsoft small business knowledge base

Article ID: 923707 - Last Review: January 17, 2015 - Revision: 1.1

This article has been archived. It is offered "as is" and will no longer be updated.

On This Page


When you try to embed a text resource in a Web application that is built on the Microsoft .NET Framework 2.0, some characters in the text resource may not appear correctly. This problem occurs when you set the PerformSubstitution parameter of the WebResource attribute to True.


The following file is available for download from the Microsoft Download Center:

Collapse this imageExpand this image
Download the .NET Framework 2.0 System.web.dll security update package now. ( For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591  ( ) How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

Note This update addresses a problem for text files that use the following encodings:
  • UTF-8 encoding
  • Other Unicode encodings that use a byte order mark (BOM) and are supported by the .NET Framework 2.0.
This update does not address a scenario in which the text resource is encoded by using an encoding that does not use a BOM, such as Windows-1252. We recommend that you do not use such encodings because browsers must then guess the encoding that is used. Therefore, results can be unpredictable.


Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.


For more information, click the following article number to view the article in the Microsoft Knowledge Base:
922770  ( ) MS06-056: Vulnerability in ASP.NET 2.0 could allow for information disclosure

Steps to reproduce the problem

  1. To embed a text resource in the application, add code that resembes the following code example.
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web.UI;
    using System.Net.Mime;
    [assembly: WebResource("CLResources.TextFile-Unicode.txt", MediaTypeNames.Text.Plain, PerformSubstitution = true)]
    [assembly: WebResource("CLResources.TextFile-UTF8-Signed.txt", MediaTypeNames.Text.Plain, PerformSubstitution = true)]
    [assembly: WebResource("CLResources.TextFile-Windows1252.txt", MediaTypeNames.Text.Plain, PerformSubstitution = true)]
    namespace CLResources
        public class Class1
  2. To use the resource in the application, add code that resembes the following code example.
    public partial class _Default : System.Web.UI.Page 
        protected void Page_Load(object sender, EventArgs e)
            HyperLinkUnicode.NavigateUrl = this.Page.ClientScript.GetWebResourceUrl(, "CLResources.TextFile-Unicode.txt");
            HyperLinkUtf8.NavigateUrl = this.Page.ClientScript.GetWebResourceUrl(, "CLResources.TextFile-UTF8-Signed.txt");
            HyperLinkWindows1252.NavigateUrl = this.Page.ClientScript.GetWebResourceUrl(, "CLResources.TextFile-Windows1252.txt");
  3. Run the application.

  • Microsoft .NET Framework 2.0
kbnosurvey kbarchive kbfix kbqfe kbresource kbstring kbdisplay KB923707
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support