Checking there are any option to read the config values directly from aspx page (I know how to read using codebehind).
Asked
Active
Viewed 4,686 times
-2
-
Similar question: http://stackoverflow.com/questions/13029873/reading-value-from-web-config-file/13029891#13029891 – IrishChieftain Oct 23 '12 at 13:25
3 Answers
0
You can do the same thing in your aspx page using some server tags e.g.
<% Dim s as string = System.Configuration.ConfigurationManager.AppSettings("mysetting") %>

AGB
- 2,378
- 21
- 37
0
You can use the ConfigurationManager
and theOBJECT
tag.
Web.Config
</configuration>
<appSettings>
<add key="Setting" value="Value"/>
<appSettings>
</configuration>
ASPX
<object>
<param name="Setting" value="<%= System.Configuration.ConfigurationManager.AppSettings["Setting"] %>" />
</object>
0
Got the solution
<%$ appsettings:*KeyName* %>
here keyname is the actual name in web.config also note you need a $ Symbol

AProgrammer
- 158
- 3
- 13