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.