0

So I'm a developer/admin for a medium size .net site, and I've run across a weird inconsistency. For reference, I'm running two instances of my site on the same server (IIS 8.5, .net 4.5); the live website and a sandbox instance of the codebase so I can test all development changes before I push them live. The config files differ only in that the sandbox site uses alternate connection strings and has it's debug flag set to true, and the sites each run on their own (identically set up) application pools.

I noticed recently that anywhere I use an asp:Image, the live site renders 'style="border-style:0px;"' onto the image tag. Interestingly, however, the sandbox instance does NOT render the style attribute.

Any idea what could be causing this discrepancy? I know that a simple solution would be to just not use asp:Images where it's a problem, but if I can I'd like to fix the underlying issue since the whole point of the sandbox is to reliably test changes on the actual server before I push them to the public site.

Josh Doebbert
  • 542
  • 4
  • 16
  • Can you see where this rule is coming from using dev tools or something? This is pretty much just pulled out of thin air but maybe there's a mysterious CSS file somewhere on production that's not present on the sandbox. – Mike G Feb 02 '15 at 18:50
  • The rule is inline css that is rendered automatically on the production site but not on the sandbox. This behavior [is documented other places](http://forums.asp.net/t/1208356.aspx?Remove+border+width+0px+from+asp+Image), but most of those references are years old and, I assume, referring to .net 4.0 or older behavior, which may have changed in 4.5. – Josh Doebbert Feb 02 '15 at 19:02
  • To be clear, we are **not** talking about [this issue](http://stackoverflow.com/q/1435576/1015495) - this is in-line CSS and not an HTML `border` attribute? – Mike G Feb 02 '15 at 19:10
  • That is correct, it is in-line css. – Josh Doebbert Feb 02 '15 at 19:12

1 Answers1

0

I got back to this issue after a few days of more pressing matters. Turns out I missed a line in my web.config. On the sandbox site, the controlRenderingCompatibilityVersion attribute of the system.web <pages> element had been updated some time ago from 3.5 to 4.0. Apparently the live site config file never got updated, and Microsoft changed the border rendering behavior between those two versions. Updated the live site and the issue resolved itself.

Josh Doebbert
  • 542
  • 4
  • 16