Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET site move to IIS7 results in gibberish characters in page output

I have an ASP.NET site that was working fine running on Windows Server 2003 / IIS6.

I moved it to Windows Server 2008 / IIS7 and the aspx page output now includes gibberish text.

For example:

p����

�����

The majority of the page renders properly, but there is gibberish here and there. I have checked the event logs and there is nothing.

Any idea what's going on here? How can I fix this?

I have noticed that this issue shows up when I include multiple Server.Execute statements in the aspx code:

<% Server.Execute("/inc/top.inc"); %>

<% Server.Execute("/inc/footer.inc"); %>

The .inc files above contain just html. It appears that the files have to be of a significant length to cause the error. Here is the sample html I've been testing with:

<div class="logo">
  <a href="/">
    <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" />
  </a>
</div>
<div class="logo">
  <a href="/">
    <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" />
  </a>
</div>
<div class="logo">
  <a href="/">
    <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" />
  </a>
</div>
<div class="logo">
  <a href="/">
    <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" />
  </a>
</div>
<div class="logo">
  <a href="/">
    <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" />
  </a>
</div>
<div class="logo">
  <a href="/">
    <img src="/logo.png" alt="logo" width="31" height="29" class="logoimg" />
  </a>
</div>

Also, the gibberish characters appear inconsistently. If I ctrl+F5 the pages, the gibberish characters change and occasionally don't appear at all.

like image 234
frankadelic Avatar asked Jun 26 '09 02:06

frankadelic


1 Answers

I would bet the problem is that what you're seeing is the regular error page, gzip-compressed. However, the gzip compression HTTP header got lost when the server was redirected to the error page, so the browser doesn't know to uncompress it. Do you have some custom module that is doing compression? Are you setting the Response.Filter?

like image 62
Scott Stafford Avatar answered Oct 06 '22 00:10

Scott Stafford