ConfigurationSettings.AppSettings : appSettings « Configuration « ASP.NET Tutorial






<%@ Page Language="VB" %>
<html>
<head>
   <script runat="server">
      Sub Page_Load()
         Message1.Text &= ConfigurationSettings.AppSettings("machineConfigKey")
         Message2.Text &= ConfigurationSettings.AppSettings("applicationConfigKey")
      End Sub
   </script>
</head>
<body>
   <asp:label id="Message1" runat="server">Machine.Config setting: </asp:label>
   <br/>
   <asp:label id="Message2" runat="server">Web.Config setting: </asp:label>
</body>
</html>

File: Web.Config

<configuration>
   <appSettings>
      <add key="applicationConfigKey" value="bar"/>
   </appSettings>
   <system.web>
      <authorization>
         <deny users="?"/>
      </authorization>
   </system.web>
</configuration>








16.3.appSettings
16.3.1.Storing Custom Settings in the web.config File
16.3.2.Retrieve values from the appSettings section either programmatically or declaratively.
16.3.3.Loading string from Web.config (C#)
16.3.4.Retrieve AppSetting
16.3.5.ConfigurationSettings.AppSettings