Page 141 - DCAP312_WEB_TECHNOLOGIES_II
P. 141

Unit 7: Advanced ASP.NET



                     <configuration>                                                              Notes
                     <system.web>
                     <compilation default Language= “c#” debug= “true”/>
                     <custom Errors mode= “Remote Only”/>
                     <authentication mode= “Windows” />
                     <Authorization>
                     <allow users= “*” />
                     </authorization>
                     <trace
                     enabled= “false”
                     request Limit= “10”
                     page Output= “false”
                     trace Mode= “Sort By Time”
                     local Only= “true”
                     />
                     <sessionState
                     mode= “InProc”
                     stateConnectionString= “tcpip=127.0.0.1:42424”
                     sqlConnectionString= “data source=127.0.0.1;Trusted_
                     Connection=yes”
                     cookieless= “false”
                     timeout= “20”
                     />
                     <globalization
                     requestEncoding= “utf-8”
                     responseEncoding= “utf-8”
                     />
                     </system.web>
                     </configuration>
            The <configuration> tag has only one child tag, which we call section group, the <system.web>
            tag. A section group typically contains the setting sections, such as: compilation, customErrors,
            authentication, authorization, etc. The way this works is pretty straightforward: we simply include
            our settings in the appropriate setting sections. We want to use a different authentication mode
            for our Web application; we had changed that setting in the authentication section.

            Apart from the standard system.web settings, we can define our own specific application settings,
            such as a database connection string, using the <app Settings> tag. Consequently, our most
            common Web.config outline would be:
                     <configuration>
                     <system.web>
                     <! — sections-->
                     </system.web>
                     <appSettings>
                     <! — sections -->
                     </appSettings >
                     </configuration>


                                             LOVELY PROFESSIONAL UNIVERSITY                                   135
   136   137   138   139   140   141   142   143   144   145   146