IIS 5 & IIS 6
corrupt html from custom asp.net control on win2003/iis6 box
Last post Jul 01, 2008 10:47 PM by steve schofield
Jun 13, 2008 06:57 PM|papafiduk|LINK
Hello everyone -- first time poster and relative newcomer to the boards. This bug I'm tackling has me at my wits' end and it's come time to turn to the masses! If this is posted in the wrong forum and/or has already been addressed, I apologize. However,
I've done thorough searches and haven't come across anything akin to what I'm facing.
I'm working with a website that has a set of custom asp.net controls, all descending from a base class. These controls take DataSets returned from web services and renders custom html via overriding the Render method. Everything works fine on my local box and
my coworker's box (both xp machines running iis 5). However, on our
server (windows server 2003, 64-bit, iis 6), the html rendered by the browser appears corrupt, with garbage replacing individual characters, as follows:
- …width="1px" bgcolor="DarkG˜‑ý></td><td>…
- …<td><p sty¨šýmargin-left:5px;…
- … style="margin-leØ
- … <p style="margin-left:5px;margin-rigèŠÿpx">…
- … valign="top" widt`|Æpx"…
Some interesting observations of this behavior:
- to reiterate, it only happens on our win2003 64-bit iis6 machine and not on xp iis5 boxes. We're not concerned with cross-browser compatibility, just the IE browser.
- the server is running with
ssl encryption, however i've ruled that out as it occurs without it as well
- the corruption of bytes follow a predictable pattern: no more than 8 bytes are corrupted in a group (on occasion 6 bytes are corrupted) and they occur on a regular interval of 0x7000 bytes. Every 0x7000 bytes after the first occurrence would be another corruption.
- when stepping through code, I've confirmed that the control/page is properly rendered on the server via a dump of the html produced by the page. So at the server, just after rendering, it's appears to be fine. However, when it hits the browser, you see the
above. This occurs in both ie6 and ie7, whenever hitting the server in question.
issues, right? I've closed off every stream utilized in the front-end. I tried toggling buffering options in iis and asp.net. I utilized the adsutil.vbs script and increased the AspBufferingLimit parameter on iis 6, but to no avail. One thing that did seem
to make a difference was the presence, or lack thereof, of other custom controls on the master page. ie: the master control usually has 3 major custom controls and then a content place holder for the given page (the html rendered for the custom page is where
the corruption is occurring.) However, if i comment out the controls on the master page such that only one is active - doesn't matter which one - everything renders correctly. Unfortunately, upon looking at the code of the controls and the base class, I don't
see any shared resources between them, nothing that would 'cause any interference.
I apologize for the length of the post, but I figure the more info the better. And again, if this is misplaced or I completely missed it addressed elsewhere, my bad.
IIS 6.0 Memory
windows server 2003
Jun 14, 2008 06:14 AM|Rovastar|LINK
I am not much of a web dev but I would look at your code a bit more rather than think things liek memory, etc and do it all in small steps
"These controls take DataSets returned from web services and renders custom html via overriding the Render method."
Break that down into manageable chunks test each section on the server platform not your own PC. Really you should try and get the dev environment the same production one.
You don't mention what versionof .net you are using on the dev and server and I presuem you are.
I know nothing about 'overriding the Render method' but a simple google of this reveals different code for different versions of .net
I would look down these lines first.
And if I understand you post correctly you think that it is ok to the overriding render method part?
hope it helps
Jun 14, 2008 02:22 PM|tomkmvp|LINK
You might also want to ask in the 64 bit IIS forums and the ASP.NET ones at http://forums.asp.net/ ...
Jul 01, 2008 03:30 PM|papafiduk|LINK
just wanted to update everyone on this...
i don't know what was hosing it exactly, but it worked correctly once i rewrote the rendering of the html to use HtmlTextWriter.WriteAttribute, etc. Previously, it was a whole bunch of string concatenations and a single call to HtmlTextWriter.Write(str)
with a massive string. Whatever the reason, that'd bonk the html when too many custom controls were rendering that way.
It was verbose and a tad tedious, but changing it so the html is produced directly with the HtmlTextWriter object fixed my issue!
Jul 01, 2008 10:47 PM|steve schofield|LINK
Wow! That makes sense. I appreciate you posting the resolution, definitely a blog post explaining this, maybe some sample code. Hint Hint!
Windows Server MVP - IIS
Log archival solution
Install, Configure, Forget