For the moment, we will not discuss why SSI should be used, rather than other technologies (such as UserControl)
To generate index.shtml, BOM must be included. In fact, blank lines will appear on the page even if it is not included.
The content of index.shtml is as follows:
<Html>
<Body>
<! -- # Include file = "head.shtml" -->
</Body>
</Html>
When 110000head.shtml is saved as a UTF-8 with BOM, a blank line appears (the page elements are more than that of course ).
22.16head.shtml is stored as a UTF-8 without BOM, garbled because SSInc. when the dll loads this file, it does not know the file encoding (because there is no BOM signature), so it will load the file by GBK, and finally garbled...
So neither can we do it. The last trick is the last one ..
Change index.shtml:
<Html>
<Body>
<! -- <! -- # Include file = "head.shtml" -->
</Body>
</Html>
Add head.shtml at the beginning of the page
<! -- BOM -->
Content
Intention to <! -- # Before include <! -- Comment out the BOM in head.shtml with HTML. There should be no problem in asp.
Two years ago, I found a problem using asp.net include, that is, its interpretation method is completely different from that of asp. If you don't believe it, try it.
<! -- <! -- # Include file = "head.shtml" --> the execution result is equivalent
<! -- # Include file = "head.shtml" -->
I tried for another half an hour and was almost desperate. I was tortured by the small problem of IE. After a random trial, we found
<! -- # <! -- # Include file = "head.shtml" -->
Ignored. For now, look forward to a better solution ..