+ All Categories
Home > Technology > Web Config

Web Config

Date post: 21-Aug-2015
Category:
Upload: dipali-shiledar
View: 532 times
Download: 3 times
Share this document with a friend
12
By Dipali Shiledar
Transcript
Page 1: Web Config

By Dipali Shiledar

Page 2: Web Config

XML file Configuration Information of the

Web Application Important root tag element is

<configuration> It is protected by IIS

Page 3: Web Config

Control Module Loading Security Configuration Session State Configuration Application Language Settings Compilation Settings Database Connection Strings

Page 4: Web Config

Better advantages over Machine.config

If Web.config file is changed, there is no need to re-compile the application

Web.config file cannot be viewed in directly in a browser

Page 5: Web Config

<?xml version="1.0" encoding="utf-8“ ?> <configuration><appSettings/><connectionStrings/><system.web></system.web>

</configuration>

Page 6: Web Config

1) <system.web> Only child of the <configuration> tag Consists of setting sections such as:

custom errors, compilation, authentication, authorization

   <authentication mode="Windows" />    <authorization> 

       <allow roles="Administrators,Users" />   </authorization>

Page 7: Web Config

2) <appSettings> Stores specific application settings

such as database connection strings <appSettings>

<add key="sConnectionString" value="Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;User Id=Your_Username;Password=Your_Password;" /></appSettings>

ConfigurationSettings.AppSettings("sConnectionString")

Page 8: Web Config

3) <customErrors> It the settings for handling web

application errors <customErrors

defaultRedirect="YourDefaultURL" mode="On|Off|RemoteOnly"><error statusCode="ErrorStatusCode" redirect="YourRedirectURL"/></customErrors> 

It can handle particular error code

Page 9: Web Config

4) <identity> It defines what identity to use

when accessing the ASP.NET application

<identity impersonate="true|false" userName="username" password="password"/> 

You should always specify username and password

Page 10: Web Config

5) <trace> Web applications trace log is

stored in application root folder as trace.axd

<trace enabled="true" localOnly="true" pageOutput="false" />

You can change the display of tracing information in the trace section.

Page 11: Web Config

6) <sessionState> It tell ASP.NET where to store

the session state    <sessionState mode="InProc"

/> It is a server side state. Information is lost when the

ASP.net process crashes and sessions become useless in Web forms

Page 12: Web Config

THANK YOU


Recommended