Friday, January 20, 2012

use of custom configuration section in web.config

Web.config consists of different configuration sections which allow the developer to configure the application. ASP.NET also allows you to create your own custom sections and section group. Today I would like to share here how to create custom section in web.config and access it in code.

In web.config you can define sections and it's key-pair value as per shown in below fig.
web.config

C#

However when putting just key/value type of stuff, there's not much benefit of using custom config sections but useful when there's multilevel hierarchy with more properties, in that case you need to define your Configuration Class also as per described here.

Read More

No comments: