Last post Nov 09, 2009 04:34 AM by withag
Nov 04, 2009 04:56 AM|withag|LINK
In the last 24 hrs I've encountered a very strange problem which seems to be specific to my computer.
Where I have a text box or similar asp.net control on a webpage, when I view the page in a browser (IE7 or firefox) the 'width="200px"' attribute is ignored and consequently all my elements are set to the default size of about 140px.
If my colleague views my project from his computer (my machine acting as the server) and views source, those attributes appear as 'style="width:200px"' as expected. So its clearly something going wrong at my end. However I can't tell if its the .NET compiler
or a browser issue, because if I view the live project from our production server I lose the width values there as well, and my colleague doesn't.
We're both running IE7 on XP with automatic updates switched on, although thats not to say they're in sync.
I don't understand what part of my machine is interpreting the <asp:textbox> tags if remote computers can render the content correctly from my machine and I can't?
Nov 04, 2009 05:11 AM|kipo|LINK
It would be interesting if you could post screenshots of the problem.
Nov 04, 2009 05:31 AM|withag|LINK
Oops I had the perfect screen shot for you until I performed a system restore back to last week which thankfully seems to have cured the problem.
Basically if you used any .net webcontrol attribute that needed to render inside a "style" tag it just got ignored, but if you put a style tag in programatically using object.attribute.add("style", "width:200px") it would work, because it wasn't required
to interpret anything, just render it.
<asp:textbox runat="server" width="200px" backcolor="#0066ff" id="txtTest"/> would end up simply <input type="text" id="txtTest"/>
Creating a normal form control with a style attribute would render correctly e.g <input type="text" id="test" style="border:1px solid red"/>
I can only assume it was caused by my recently uninstalling Adobe Reader 7 and upgrading to Adobe Reader 9 because it was affecting all my browsers but no one elses computers had the problem, but I am still curious to know how that could happen because I
thought IIS had to compile the aspx/ascx code to HTML before serving it to the client, so my machine must have been doing something strange after that bit, because my localhost was serving the correct HTML to everyone else just fine!
Nov 06, 2009 05:36 AM|urstop|LINK
It looks to be your browser issue. As you said you can see the style attribute in view source with the correct width, so your IIS and .NET are doing fine. Did you install some softwares which install some browser ad-ons which might be interfering with its
Try disabling all 3rd party browser toolbars/plugins/ad-ons and see if that works.
Nov 09, 2009 04:34 AM|withag|LINK
It turns out that it wasn't related to Adobe Reader, but a Windows Live Messenger update (which makes a lot more sense given the type of interference it was causing).
I let Windows Live Messenger update selected components up to build 14.0.8089.726 first thing this morning and instantly the problem returned.
I performed a system restore back to the previous day (Windows Live Messenger build 14.0.8064.206) and the problem went away.
I'm surprised I haven't heard of more people having this issue, but maybe it was because I refused to let it install the full suite of useless apps I don't need that was causing something to go wrong. Anyway, hope this info helps someone!