Web Config

692 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
692
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Server-wide configuration settings for the .NET Framework are defined in a file called Machine.config. The settings in the Machine.config file can be changed and those settings affect all .NET applications on the server.  Different ASP.NET applications might need different application settings, that’s why defining those settings in the Machine.config file, is usually not practical.
  • Web Config

    1. 1. By Dipali Shiledar
    2. 2. <ul><li>XML file </li></ul><ul><li>Configuration Information of the Web Application </li></ul><ul><li>Important root tag element is <configuration> </li></ul><ul><li>It is protected by IIS </li></ul>
    3. 3. <ul><li>Control Module Loading </li></ul><ul><li>Security Configuration </li></ul><ul><li>Session State Configuration </li></ul><ul><li>Application Language Settings </li></ul><ul><li>Compilation Settings </li></ul><ul><li>Database Connection Strings </li></ul>
    4. 4. <ul><li>Better advantages over Machine.config </li></ul><ul><li>If Web.config file is changed, there is no need to re-compile the application </li></ul><ul><li>Web.config file cannot be viewed in directly in a browser </li></ul>
    5. 5. <ul><li><?xml version=&quot;1.0&quot; encoding=&quot;utf-8“ ?> <configuration> </li></ul><ul><li><appSettings/> </li></ul><ul><li><connectionStrings/> </li></ul><ul><li><system.web> </li></ul><ul><li></system.web> </li></ul><ul><li></configuration> </li></ul>
    6. 6. <ul><li><system.web> </li></ul><ul><li>Only child of the <configuration> tag </li></ul><ul><li>Consists of setting sections such as: custom errors, compilation, authentication, authorization </li></ul><ul><li>    <authentication mode=&quot;Windows&quot; /> </li></ul><ul><li>    <authorization>         <allow roles=&quot;Administrators,Users&quot; />    </authorization> </li></ul>
    7. 7. <ul><li>2) <appSettings> </li></ul><ul><li>Stores specific application settings such as database connection strings </li></ul><ul><li><appSettings> <add key=&quot;sConnectionString&quot; value=&quot;Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;User Id=Your_Username;Password=Your_Password;&quot; /> </appSettings> </li></ul><ul><li>ConfigurationSettings.AppSettings(&quot;sConnectionString&quot;) </li></ul>
    8. 8. <ul><li>3) <customErrors> </li></ul><ul><li>It the settings for handling web application errors </li></ul><ul><li><customErrors defaultRedirect=&quot;YourDefaultURL&quot; mode=&quot;On|Off|RemoteOnly&quot;> <error statusCode=&quot;ErrorStatusCode&quot; redirect=&quot;YourRedirectURL&quot;/> </customErrors>  </li></ul><ul><li>It can handle particular error code </li></ul>
    9. 9. <ul><li><identity> </li></ul><ul><li>It defines what identity to use when accessing the ASP.NET application </li></ul><ul><li><identity impersonate=&quot;true|false&quot; userName=&quot;username&quot; password=&quot;password&quot;/>  </li></ul><ul><li>You should always specify username and password </li></ul>
    10. 10. <ul><li>5) <trace> </li></ul><ul><li>Web applications trace log is stored in application root folder as trace.axd </li></ul><ul><li><trace enabled=&quot;true&quot; localOnly=&quot;true&quot; pageOutput=&quot;false&quot; /> </li></ul><ul><li>You can change the display of tracing information in the trace section. </li></ul>
    11. 11. <ul><li>6) <sessionState> </li></ul><ul><li>It tell ASP.NET where to store the session state </li></ul><ul><li>    <sessionState mode=&quot;InProc&quot; /> </li></ul><ul><li>It is a server side state. </li></ul><ul><li>Information is lost when the ASP.net process crashes and sessions become useless in Web forms </li></ul>
    12. 12. THANK YOU

    ×