Advantages of Web.config file
Asp.net web application which contains web.config file. Every day we are using web.config file but most of the developers are not familiar with usage and advantages of web.config file. This article will helps the developers to identifying the exact advantages of web.config file and its usage.
Below are the list of basic advantages of web.config file
1. Connection string settings
2. AppSettings
3. HTTP Handlers settings
4. Custom Error configurations
5. Session state and View State configurations
6. Authentication, Authorization settings
7. Custom Configuration settingsConnection string settings
The is one of the most common section in web.config file. It allow the users to create multiple connection strings here. Below are the general connection string settingsAppSettings
The AppSettings configuration which helps the developers to create their custom keys, file paths, URLS etc... Below are the general settings for AppSettingsHandlers settings
HttpHandler is a code that executes when an http request for a specific resource is made to the server. For example, if we request an .aspx page the ASP.NET page handler is executed.
Below are the details of http handler settings for image handlerCustom Error configurations
We can set our custom error code configurations based on the Error code so whenever we get the error code while running the application it will redirect to the custom error page because of this we no need to write any C# code. The Web config custom error code configuration will handle this error.
Below are the details of custom error configurations.Session state and View State configurations
We can enable our Session state and View State settings in web.config itself. Below is the configuration of enabling view state through web. Config.
Here we can set true / false based on our requirement
The below is the configuration which is used to define Session State configurationsAuthentication, Authorization settings
Another one of the cool feature in web.config is Authorization and Authentication settings
Below are the general settings for Authentication and AuthorizationAuthentication Settings
Authorization Settings
The page will display according to the above settings.Custom Configuration settings
In this section we can define our own settings like color settings, custom URL settings etc..Below are the example for custom configuration settings
Likewise we can define our custom configurations.These are all the some basic advantages of web. Config.
Hi,
That was a good article. Really a useful one!!!!
Thanks
Vetri