Description of the convenient sitefactory configuration file (Web. config)

Source: Internet
Author: User

 
The easy-to-use sitefactory configuration file is complicated, which is a headache for many users who are not doing. NET web programming. The following describes the website Web. config content and how to modify it.

Configuration declaration Section
<Configsections>
<Section name = "enterpriselibrary. configurationsource "type =" Microsoft. practices. enterpriselibrary. common. configuration. configurationsourcesection, Microsoft. practices. enterpriselibrary. common, version = 3.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a "/>
<Section name = "dataconfiguration" type = "Microsoft. practices. enterpriselibrary. data. configuration. databasesettings, Microsoft. practices. enterpriselibrary. data, version = 3.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a "/>
<Section name = "urlrewritingnet" requirepermission = "false" type = "urlrewritingnet. configuration. urlrewritesection, urlrewritingnet. urlrewriter"/>
<Sectiongroup name = "system. web. extensions "type =" system. web. configuration. systemwebextensionssectiongroup, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 ">
<Sectiongroup name = "scripting" type = "system. Web. configuration. scriptingsectiongroup, system. Web. Extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35">
<Section name = "scriptresourcehandler" type = "system. web. configuration. scriptingscriptresourcehandlersection, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "requirepermission =" false "allowdefinition =" machinetoapplication "/>
<Sectiongroup name = "WebServices" type = "system. Web. configuration. scriptingwebservicessectiongroup, system. Web. Extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35">
<Section name = "jsonserialization" type = "system. web. configuration. scriptingjsonserializationsection, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "requirepermission =" false "allowdefinition =" everywhere "/>
<Section name = "profileservice" type = "system. web. configuration. scriptingprofileservicesection, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "requirepermission =" false "allowdefinition =" machinetoapplication "/>
<Section name = "authenticationservice" type = "system. web. configuration. scriptingauthenticationservicesection, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "requirepermission =" false "allowdefinition =" machinetoapplication "/>
</Sectiongroup>
</Sectiongroup>
</Sectiongroup>
<Sectiongroup name = "powereasy. Web" type = "powereasy. Web. configuration. componentssectiongroup, powereasy. Web">
<Section name = "querystrings" type = "powereasy. Web. configuration. querystringssection, powereasy. Web"/>
<Section name = "security" type = "powereasy. Web. configuration. securitysection, powereasy. Web"/>
</Sectiongroup>
</Configsections>
This section defines that the name of the specific configuration node will be used in the web. config file. Program And so on.
It can be seen from this that the. NET Enterprise Application Block (enterpriselibrary) and data access block are used in sitefactory.
Urlrewritingnet is used for address rewriting, followed by the Asp.net Ajax configuration section declaration, and finally a sectiongroup declaration. The configuration section declaration in it is: sitefactory page access control (Security ), page access parameters (. aspx? Xxx section after XXX question mark)

After the statement is made, it is the specific data configuration node.
<Connectionstrings configsource = "config \ connectionstrings. config"/>
This is the configuration of the database connection string. The specific data is in the connectionstrings. config file under the config directory. Open this file and you can see the following content:
<! -- Specifies a set of database connection strings (in the form of name/value pairs. -->
<Connectionstrings>
<Add name = "connection string" connectionstring = "Server =.; database = sitefactory; uid = powereasy; Pwd = 123456"
Providername = "system. Data. sqlclient"/>
</Connectionstrings>
Here is the familiar database connection string content. You can change the xxx content in connectionstring = "XXX" to your current database connection configuration as needed.
<Httphandlers>
<Remove verb = "*" Path = "*. asmx"/>
<Add verb = "*" Path = "*. asmx "Validate =" false "type =" system. web. script. services. scripthandlerfactory, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>
<Add verb = "*" Path = "* _ appservice. axd "Validate =" false "type =" system. web. script. services. scripthandlerfactory, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>
<Add verb = "Get, head" Path = "scriptresource. axd "type =" system. web. handlers. scriptresourcehandler, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "Validate =" false "/>
<Add verb = "*" Path = "Reserved. reportviewerwebcontrol. axd "type =" Microsoft. reporting. webforms. httphandler, Microsoft. reportviewer. webforms, version = 8.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a "/>
<Add verb = "*" Path = "*. jpg" type = "powereasy. Web. noleechimagehandler, powereasy. Web"/>
<Add verb = "*" Path = "*. GIF" type = "powereasy. Web. noleechimagehandler, powereasy. Web"/>
<Add verb = "*" Path = "*. PNG" type = "powereasy. Web. noleechimagehandler, powereasy. Web"/>
</Httphandlers>

Here is the processing program configuration. The first few are Asp.net Ajax, and the last three are sitefactory used to prevent image piracy. The specific implementation idea is, determine whether the referrer in the header of the image file request is the address of the website. If your website does not require anti-theft connection, you may steal others "_-!) You can use
<! --
<Add verb = "*" Path = "*. jpg" type = "powereasy. Web. noleechimagehandler, powereasy. Web"/>
<Add verb = "*" Path = "*. GIF" type = "powereasy. Web. noleechimagehandler, powereasy. Web"/>
<Add verb = "*" Path = "*. PNG" type = "powereasy. Web. noleechimagehandler, powereasy. Web"/>
--> Comment out the three marked items.

<Httpmodules>
<Add name = "refreshmodule" type = "powereasy. Web. httpmodule. refreshmodule, powereasy. Web"/>
<Add name = "commonmodule" type = "powereasy. Web. httpmodule. commonmodule, powereasy. Web"/>
<Add name = "iplockmodule" type = "powereasy. Web. httpmodule. iplockmodule, powereasy. Web"/>
<Add name = "exceptionmodule" type = "powereasy. Web. httpmodule. exceptionmodule, powereasy. Web"/>
<Add name = "securitymodule" type = "powereasy. Web. httpmodule. securitymodule, powereasy. Web"/>
<Add name = "querystringmodule" type = "powereasy. Web. httpmodule. querystringmodule, powereasy. Web"/>
<Add name = "httpuploadmodule" type = "powereasy. Controls. extendeduploadfile. httpuploadmodule, powereasy. Controls"/>
<Add name = "scriptmodule" type = "system. Web. Handlers. scriptmodule, system. Web. Extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35"/>
<Add name = "urlrewritemodule" type = "urlrewritingnet. Web. urlrewritemodule, urlrewritingnet. urlrewriter"/>
</Httpmodules>
It is a processing module. Except for the scriptmodule specified by Asp.net Ajax, most of the other processing modules are sitefactory. You can block some
For example, refresmodule is used to prevent refresh, and iplokemodule is used to block IP addresses ....

In addition, pay attention. A <system. webserver>... </system. webserver> section, which is newly added by iis7.0 and has the same nature as

<! -- Configure session Status settings for the current application. -->
<Sessionstate mode = "inproc" timeout = "20">
Indicates that the user session is saved in process 20, indicating the expiration time. However, the actual expiration time of sessionstate depends on the server load.
<Urlmappings enabled = "true">
<Clear/>
<Add url = "~ /Index. aspx "mappedurl = "~ /Default. aspx "/>
<Add url = "~ /User/index. aspx "mappedurl = "~ /User/default. aspx "/>
</Urlmappings>

Urlmappings is the address rewriting wit that comes with. net2.0. It does not support regular expressions, but most applications can meet the requirements and are very convenient.

<Webparts>
<Personalization defaultprovider = "webpartpersonalizationprovider">
<Providers>
<Add name = "webpartpersonalizationprovider" type = "powereasy. usermanage. webpartprovider, powereasy. usermanage"/>
</Providers>
</Personalization>
</Webparts>

This section is the configuration of webparts personalized data storage provided by sitefactory. In addition, ASP. net2.0 also provides an SQL implementation provider. You can use aspnet_regsql.

<Urlrewritingnet configsource = "config \ urlrewritesettings. config"/>
<Powereasy. Web>
<Security configsource = "config \ Security. config"/>
<! -- Specify the set of parameters passed on the page. -->
<Querystrings configsource = "config \ querystrings. config"/>
</Powereasy. Web>
These pairs of data are mostly in the file at the top of the finger. You can view them in the config directory,

Createcollectionwork is available in the config directory except for the exception. config, createhtmlwork. config is used for data collection and static page generation. It is used to exchange information between processes. site. config and so on are specific data files that are saved through class serialization. For example, the length of the anti-Refresh queue is saved in this file. You can modify the settings in the background or directly modify the settings here.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.