Server Side Includes (SSI) adding a blank/empty line to HTML page

by Filip Stanek 28. August 2008 17:28

While creating a page that used server side includes, I ran into some very strange behavior.  Right before each SSI, a blank line would appear on the page.  It didn't have anything to do with margins or padding.  It was just like an empty line appeared right out of nowhere, messing up the layout.  First, I thought it was some problem with IIS and SSI, but I couldn't find anything there.

After a few hours of frustration and trying the weirdest solutions I could think of, I started playing around with saving the include files with different file names. Well, when I got to the *.txt, I noticed that Visual Studio gives me a new option under "Save As"... its "Advanced Save Options". When I looked at the encoding of the file, it was set to "Unicode (UTF-8 with signature) - Codepage 65000".  I then switched to "Unicode (UTF-8 without signature) - Codepage 65001", and the blank lines disappeared. 

It appears that Visual Studio picks an encoding when saving pages that doesn't really produce desirable effects when using server side includes.  However, you can go to File -> Advanced Save Options and select a different encoding.  I'm not sure how to set the one w/o signature as the default yet, but hopefully soon I'll figure that out :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Web Development

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About Filip Stanek

Death Note Pic I'm a developer at ACG Multimedia in Cincinnati, OH. Besides working with ASP.NET, Flash, and other web technologies, I enjoy playing chess, Rockband, and keeping up with the recent events (US elections this year are actually fun!).
E-mail me Send mail

Recent Comments

Comment RSS