Web.config appsettings
How can I use the k开发者_如何学Cey value that is inside my web.config directly from the asp.net webpage i.e using the <%$ %>
See ASP.Net Expressions Overview
Example from that page
Web.config...
<appSettings>
<add key="copyright" value="(c)Copyright 2004 Northwind Traders"/>
</appSettings>
Then you can use...
<%$ AppSettings: copyright %>
<%= ConfigurationManager.AppSettings["key_name"] %>
I think
<%$Appsettings:KeyName %>
Should do what you need.
This uses the AppSettingsExpressionBuilder
described here https://web.archive.org/web/20110107080439/http://www.4guysfromrolla.com/demos/printPage.aspx?path=/articles/022509-1.aspx
<%= ConfigurationManager.AppSettings["mySetting"] %>
精彩评论