General web. config Configuration

Source: Internet
Author: User

<? Xml version = "1.0" encoding = "UTF-8"?>
<! -- XML file declaration, group version and encoding form -->
<! --Note: In addition to manually editing this file, you can also use
   Web management tools to configure application settings. You can use
    "Website"-> "Asp. Net configuration" option.
   The complete list of settings and comments is displayed in
   In machine. config. comments, this file is usually located in
   \ Windows \ Microsoft. Net \ Framework \ v2.x \ Config
-->
<! -- Root element of the XML file -->
<Configuration>
 <! -- Deleettings: Contains custom application settings, such as file path -->
 <Deleetask>
   <Add key = "conn" value = "select employeeid. lastname, city from employees"/> <! -- Here we can change the value of value to the connection string for database connection. -->
 </AppSettings>
 <! -- ConnectionStrings: Specifies the database connection string (name/value pair
 Form) set -->
 <ConnectionStrings>
   <Add name = "conn" connectionString = "server =.; database = northwind; uid = sa; pwd =;"/>
 </ConnectionStrings>
   <System. web>
     <! -- Pages: sets whether the page attribute and buffer is cached. [true: cache, false: no cache] -->
     <Pages buffer = "true"> </pages>
       <! --
           Set compilation debug = "true" to insert the debugging symbol
           Compiled pages. However, this
           Performance is affected, so this value is only available during development.
           Set to true.
       -->
     <! -- Compilation: whether to debug and compile the page -->
     <! -- Set whether to debug the program. debugging can help you identify errors. If you do not debug the program, the program running speed can be improved. -->
       <Compilation debug = "false"/>
       <! --
           In the <authentication> section, you can configure
           Security Authentication mode,
           To identify the user.
       -->
     <! --Authentication
         This section sets the authentication policy for the application. Possible modes are Windows ",
         "Forms", "Passport", and "None"

         "None" does not perform authentication.
         "Windows" IIS performs Authentication Based on application settings
           (Basic, simple, or integrated Windows ). Anonymous access must be disabled in IIS.
         "Forms" you provide users with a custom form (Web page) for entering creden,, and then
          Verify their identity in your application. User creden are stored in cookies.
         "Passport" authentication is performed through Microsoft's centralized identity authentication service,
          It provides independent logon and core configuration file services for member sites.
   -->
     <Authentication mode = "Forms">
       <! -- Authentication -->
       <Forms name = "name" defaultUrl = "index. aspx" loginUrl = "login. aspx" protection = "All"/>
     </Authentication>
     <! --Authorization
          This section sets the application Authorization Policy. Allow or Deny Access From different users or roles
         Application resources. Wildcard: "*" indicates anyone ,"? "Anonymous
         (Unauthenticated) user.
   -->

     <Authorization>
       <Allow users = "*"/>
       <! -- Allow all users -->
       <! --<Allow   Users = "[comma-separated user list]"
                            Roles = "[list of roles separated by commas]"/>
                 <Deny    Users = "[comma-separated user list]"
                            Roles = "[list of roles separated by commas]"/>
           -->
     </Authorization>
       <! --
           If an unprocessed error occurs during request execution,
           You can configure the corresponding processing steps in the <mermerrors> section. Specifically,
           This section allows developers to configure
           Html error page to be displayed
           To replace the error stack trace.
       -->
     <! -- Define the page to be accessed when an error occurs! -->
     <! -- CustomErrors: custom error message, which can be displayed in three ways -->
       <CustomErrors mode = "On" defaultRedirect = "errors. aspx">
         <! --
         <Error statusCode = "403" redirect = "NoAccess.htm"/>
           <Error statusCode = "404" redirect = "FileNotFound.htm"/>
           -->
       </CustomErrors>
       
   </System. web>
 <! -- Location: Specifies the resource configured by the application subconfiguration. This element also locks configuration settings to prevent
 Subconfiguration file to overwrite these settings -->
 <Location path = "Admin">
   <System. web>
     <Authorization>
       <! -- Prohibit anonymous users from accessing the Admin folder and its files -->
       <Deny users = "? "/>      
     </Authorization>
   </System. web>
 </Location>
</Configuration>

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.