ASP.NET Web Applications ASP.NET Configuration
You can access public configuration settings from within an ASP.NET application by using the intrinsic static methods exposed by ASP.NET. For example, to read the value of the cookieless attribute of the <sessionState> section:
bool nocookies = Session.Cookieless;
Dim nocookies As Boolean = Session.Cookieless
Application-specific settings stored within the top-level <appSettings> section of Web.config files can be accessed using the ConfigurationSettings.AppSettings static string collection. For example,
Web.config
String dsn = ConfigurationManager.ConnectionStrings [ "dsn" ];
Dim dsn As String = ConfigurationManager.ConnectionStrings ( "dsn" )
ASP.NET Configuration Sections Format of ASP.NET Configuration Files Hierarchical Configuration Architecture
© 2025 Reynald Nuñez and asp.net.ph. All rights reserved. If you have any question, comment or suggestion about this site, please send us a note