asp.net.ph

Skip Navigation LinksHome > ASP.NET Applications > ASP.NET Configuration > Accessing Configuration Settings

Accessing Configuration Settings

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;
  C# VB

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,

String dsn = ConfigurationManager.ConnectionStrings [ "dsn" ];
  C# VB

See Also

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