Configuring IIS 7.5 to enable server side includes (SSI) for the '.html' extension

自闭症网瘾萝莉.ら 提交于 2019-12-03 08:35:33

Hey got the answer just needed to surf some more Here is the link where you can configure IIS server to use Server side include for .html pages as its default provided for .shtml but I didnt wanted that. this link is very helpful

http://tech.mikeal.com/blog1.php/server-side-includes-for-html-in-iis7

You can try something likes below.

CONFIGURATION SAMPLE

The following configuration sample disables the #exec command for SSI files in the Default Web Site.

<location path="Default Web Site">
   <system.webServer>
      <serverSideInclude ssiExecDisable="true" />
   </system.webServer>
</location>

C# file looks like below

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();

         ConfigurationSection serverSideIncludeSection = config.GetSection("system.webServer/serverSideInclude", "Default Web Site");
         serverSideIncludeSection["ssiExecDisable"] = true;

         serverManager.CommitChanges();
      }
   }
}

You can get more information Server Side Include

For your 2nd Question:

You can use Master page.Then all inherited pages will have both headers and Footers.

I hope this will help to you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!