日期:2014-05-17  浏览次数:20467 次

asp.net C#整个网站静态化,请教高手
asp.net C#整站静态化应怎么做,在网站找到的有一些教程,但都一知半解。配置文件如下
<?xml version="1.0"?>
<!-- 
  注意: 除了手动编辑此文件以外,您还可以使用 
  Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
  “网站”->“Asp.Net 配置”选项。
  设置和注释的完整列表在 
  machine.config.comments 中,该文件通常位于 
  \Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>
  <configSections>
  <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
  </configSections>
  <RewriterConfig>
  <Rules>
  <!-- 规则1 -->
  <RewriterRule>
  <LookFor>~/d(\d+)\.html</LookFor>
  <SendTo>~/default.aspx?id=$1</SendTo>
  </RewriterRule>
  <!-- 规则2 -->
  <RewriterRule>
  <LookFor>~/k(\d+)\.html</LookFor>
  <SendTo>~/default.aspx?key=$1</SendTo>
  </RewriterRule>
  </Rules>
  </RewriterConfig>

  <connectionStrings>
  <add name="webtest" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\webtest.mdb" providerName="System.Data.OleDb"/>

  <!--
  用户数据库
<add name="webtest" connectionString="Data Source=61.152.93.48;Initial Catalog=test081125;Persist Security Info=True;User ID=test081125;Password=test081125" providerName="System.Data.SqlClient"/>
-->
   
</connectionStrings>
<appSettings/>
<system.web>
  <!--AjaxPro_Start-->
  <httpHandlers>
  <remove verb="*" path="*.asmx"/>
  <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
  <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
   
  </httpHandlers>
  <httpModules>
  <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
  </httpModules>
  <!--AjaxPro_End-->
<!-- 
  设置 compilation debug="true" 可将调试符号插入
  已编译的页面中。但由于这会 
  影响性能,因此只在开发过程中将此值 
  设置为 true。
  -->
  <identity impersonate="false"/>
<compilation debug="true">
<assemblies>
   
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   
  </assemblies></compilation>

  <!--
  通过 <authentication> 节可以配置 ASP.NET 用来 
  识别进入用户的
  安全身份验证模式。 
  -->
<authentication mode="Windows"/>
<!--
  如果在执行请求的过程中出现未处理的错误,
  则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
  开发人员通过该节可以配置
  要显示的 html 错误页