您的位置:首页 > Web前端 > HTML

IIS7 支持html页面包含(include)html页面 IIS设置与代码编写

2012-04-13 17:14 357 查看
1:处理映射程序

添加模块映射 请求路径 *.html 模块选择 ServerSideIncludeModule,名称填写:SSINC-html

2:重新启动IIS

3:其中一个页面 中写 <!--#include virtual="/IndexInclude/aa.html" -->

4:aa.html 为utf-8编码,发现在引入后页面有空白页,请删除BOM

5:生成aa.html时 编码

 Encoding code = new UTF8Encoding(false); // create encoding with no BOM

StreamWriter sw = new StreamWriter(path + htmlfilename, false, code);

这样就解决IIS7不支持include的问题,以及出现页面空白的问题。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  iis html include encoding path
相关文章推荐