Advantages of using web.config

Web.config is the main settings and configuration file for an ASP.NET web application. The file is a XML document that defines configuration information regarding the web application. In this article I will explain the main advantages of using the web.config file

Connection string settings

This section specifies a collection of database connection strings for ASP.NET applications and features.

connectionstring web config arvixe


<connectionStrings >
   <add />
   <clear />
   <remove />


This element stores custom application configuration information such as database connection strings, file paths, XML Web service URLs, or any information stored in an application’s .ini file.

appsettings web config arvixe


       <add key="Application Name" value="MyApplication" />

Handlers settings

This enables ASP.NET to call the HTTP handler in order to service requests for resources that have the specified file name extension.

httphandlers web config arvixe


<add verb="*" path="*.SampleFileExtension"          type="SampleHandler2 " />   

Custom Error configurations

With this we can set up custom errors. The customErrors element can be defined at any level of the hierarchy of application files.

customerrors web config arvixe


<customErrors defaultRedirect="GenericError.htm"  mode="RemoteOnly">     
<error statusCode="500"             redirect="InternalError.htm"/>   

Authentication and Authorization

Web.config allows us to establish who can access our application and specify which parts of our application.

authentication web config arvixe


<authentication mode="Forms">        
 <forms name="401kApp" loginUrl="/login.aspx"/>    
   <deny users="?"/>    

These are some of the features and advantages of the web.config file. It is very important to know that we can do. In this way we can control security levels, connections to databases, authorize users, customize and manage errors.

This concludes Advantages of using web.config

Looking for quality Windows Hosting? Look no further than Arvixe Web Hosting!

Happy Hosting!

Rodolfo Hernandez

Tags: , , , , , , , , , , , , , | Posted under ASP .NET 3.5, DotNet/Windows Hosting | RSS 2.0

Author Spotlight

Rodolfo Hernandez

I like photography and reading books. Currently working for Arvixe as Elgg Community Liaison. Elgg Security Expert Web Security Expert CEO of UDP SW Social Web

Leave a Reply

Your email address will not be published. Required fields are marked *