aspxtreme

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 = ConfigurationSettings.AppSettings [ "dsn" ];
  C# VB

See Also

ASP.NET Configuration Sections   Format of ASP.NET Configuration Files   Hierarchical Configuration Architecture



Books and more ...


Suggested Reading

Need a break ?



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme