Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Render Method in BasePartialCachingControl Class Renders by Using HtmlTextWriter


View products that this article applies to.

This article was previously published under Q321552

↑ Back to the top


Symptoms

The Render method in the BasePartialCachingControl class renders by using a writer of type HtmlTextWriter. This frequently occurs when you use an OuputCache directive for user controls. When a down-level browser browses to the page, the browser continues to use HtmlTextWriter instead of Html32TextWriter to render the user control.

For example, the following user control
<%@ Control Language="c#" %>
<%@ OutputCache Duration="30" VaryByParam="none" %>
<asp:TextBox id="txt" runat="server" Width="442px" />
				
should be rendered as follows for down-level browsers:
<input name="txt" id="txt" type="text" />
				
However, because a HtmlTextWriter type is used to render cached controls, the browser renders the user control as follows:
<input name="txt" id="txt" style="width:449px;" type="text" />
				
Notice the style attribute.

↑ Back to the top


Resolution

To resolve this problem, obtain the latest service pack for Microsoft .NET Framework. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
318836� INFO: How to Obtain the Latest .NET Framework Service Pack
The English version of this fix should have the following file attributes or later:
   Date         Time   Version           Size     File name
   --------------------------------------------------------------
   17-Apr-2002  20:45  1.0.3705.252      192,512  Aspnet_isapi.dll  
   17-Apr-2002  20:39                     19,332  Aspnet_perf.ini
   17-Apr-2002  20:45  1.0.3705.252       24,576  Aspnet_regiis.exe  
   17-Apr-2002  20:45  1.0.3705.252       28,672  Aspnet_wp.exe    
   20-Mar-2002  13:31                      8,709  Smartnav.js
   20-Mar-2002  13:31                      7,003  Smartnavie5.js
   19-Apr-2002  10:40  1.0.3705.252    1,183,744  System.web.dll   
				

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft .NET Framework Service Pack 2 (SP2).

↑ Back to the top


More information

After you apply the fix, cached controls (for example, user controls that include the OuputCache directive) are rendered by using the writer that is associated with the page instead of by using HtmlTextWriter.

If you use a down-level browser, the writer is of type Html32TextWriter. If you use an up-level browser, the writer is of type HtmlTextWriter.

↑ Back to the top


Keywords: KB321552, kbservercontrols, kbnetframe100sp2fix, kbnetframe100presp2fix, kbfix, kbcaching, kbbug, kbqfe, kbhotfixserver

↑ Back to the top

Article Info
Article ID : 321552
Revision : 4
Created on : 9/27/2005
Published on : 9/27/2005
Exists online : False
Views : 397