Utilizzare appsettings del web.config per memorizzare delle variabili globali dell'applicazione
web.config
<configuration>
<appsettings>
<add key="chiave" value="valore"/>
</appsettings>
</configuration>
pagina
<html>
<script language="c#" runat=server>
private void Page_Load(object sender, System.EventArgs e)
{
Hashtable AppSettings = Context.GetConfig("appsettings");
myLabel.Text = AppSettings["chiave"];
}
</script>
<body>
Dal web.config: <asp:label id="myLabel" runat=server/>
</body>
</html>
Scarica il Codice...
Stampa la pagina