(实战篇)如何配置web.config
生活随笔
收集整理的這篇文章主要介紹了
(实战篇)如何配置web.config
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
延續之前的,這一期主要看看項目實際運用中的web.config配置
(1)appSettings節點信息配置,保存全局配置信息
<appSettings>
<!--首次跳轉菜單頁面 -->
<add key="DefaultToDone" value="已辦"/>
<add key="DefaultToNew" value="新建"/>
<add key="DefaultToSearch" value="查詢"/>
<add key="Skin" value="DefaultTheme,Green,Blue,Gray,Orange"/>
</appSettings>
(2)connectionStrings 數據庫連接配置信息
<connectionStrings>
<add name="ConnectionPructionKey" connectionString="data source=SERVER2;initial catalog=TEST;integrated security=false;persist security info=True;User ID=sa;Password=@pass;Application Name=group" providerName="System.Data.SqlClient"/>
<add name="FileConnectionKey" connectionString="data source=SERVER2;initial catalog=File_TEST;integrated security=false;persist security info=True;User ID=sa;Password=@pass;Application Name=group" providerName="System.Data.SqlClient"/>
<add name="LogConnectionKey" connectionString="data source=SERVER2;initial catalog=CLog_TEST;integrated security=false;persist security info=True;User ID=sa;Password=@pass;Application Name=group" providerName="System.Data.SqlClient"/>
</connectionStrings>
(3)system.web下httpmoudle和httphandler,附件大小信息的配置
<system.web>
<httpHandlers>
<add verb="*" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
<add verb="*" path="FWMODALDIALOG.ASPX" type="CIT.OA.CommonUI.HttpHandler.FWHttpHandlerFactory, CIT.OA.CommonUI, Version=1.0.0.0, Culture=neutral"/>
<add verb="*" path="FWAJAX.ASPX" type="CIT.OA.CommonUI.HttpHandler.FWHttpHandlerFactory, CIT.OA.CommonUI, Version=1.0.0.0, Culture=neutral"/>
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
<remove verb="*" path="*.asmx"/>
</httpHandlers>
<httpModules>
<add name="OnlineModule" type="CIT.OA.CommonUI.HttpModule.OnlineModule, CIT.OA.CommonUI, Version=1.0.0.0, Culture=neutral"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
<httpRuntime useFullyQualifiedRedirectUrl="false" maxRequestLength="2048000" executionTimeout="3600"></httpRuntime>
</system.web>
httphandler和httpmoudle的區別在以后會詳細闡述,另外httpruntime可以限定附件上傳的大小和超時時間,應該注意!web.config是整個站點的配置文件,里面的配置很復雜,這里列出的只是最常用的幾個節點配置,對于一般的項目已經足夠。
總結
以上是生活随笔為你收集整理的(实战篇)如何配置web.config的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 原创:《异形》吓哭小孩,谁之过?
- 下一篇: 原创:霉霉奥地利演唱会受到袭击威胁?她首