Incorrect HTML sent to browser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two usercontrols on the home page of my website. They are intermitently sending incorrect HTML to the browser, which results in a textbox being rendered with the wrong width. Either both controls render correctly or both are incorrect but never a mixture. When they are rendered correctly the source looks like

<input name="Header2:txtKeyword" type="text" id="Header2_txtKeyword" style="width:80px;" /

When incorrect the source looks like

<input name="Header2:txtKeyword" type="text" id="Header2_txtKeyword" /

The asp.net code in both cases is

<asp:TextBox ID="txtKeyword" Runat="server" Width="80"></asp:TextBox

Is there any reason why different HTML is being generated for the same browser on the same machine and how to ensure the width property is rendered correctly?
 
HTML rendered from the control depends upon broswer from which you are
trying to access this control. It might vary if you are trying to access it
from different browser.

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com



Linda Wienholt said:
I have two usercontrols on the home page of my website. They are
intermitently sending incorrect HTML to the browser, which results in a
textbox being rendered with the wrong width. Either both controls render
correctly or both are incorrect but never a mixture. When they are rendered
correctly the source looks like:
<input name="Header2:txtKeyword" type="text" id="Header2_txtKeyword" style="width:80px;" />

When incorrect the source looks like:

<input name="Header2:txtKeyword" type="text" id="Header2_txtKeyword" />

The asp.net code in both cases is:

<asp:TextBox ID="txtKeyword" Runat="server" Width="80"></asp:TextBox>

Is there any reason why different HTML is being generated for the same
browser on the same machine and how to ensure the width property is rendered
correctly?
 
Linda said:
I am trying to access the pages from the same browser IE6 on the same machine. Sometimes it works and sometimes it doesn't??

Set trace="true" in the page's @Page directive. This will dump trace
information at the end of each response.

See if the server indicates that it's getting different User-Agent
header information (or some other different infomration in the request)
when the page works and when the page doesn't work.

Maybe a proxy is filtering some information sometimes and not others for
some reason, or you're going through different proxies on different
requests, or something.
 
Back
Top