jtby
asked on
Accessing appSettings syntax- Hardcoded value replaced with appSettings
Currently I have a value that is hardcoded and I need to change it to a setting found in the web.config. I have a web.config file with a Key <add key="AVLLayer" value="AVL"/> I need to access this in the Default.aspx. See below
In web.config I have
<appSettings>
<add key="AVLLayer" value="AVL"/>
</appSettings>
in Default2.aspx I have
<esri:MapResourceItem Definition="<Definition DataSourceDefinition="testweb" DataSourceType="ArcGIS Server Local" Identity="" ResourceDefinition="(default)@AVL" DataSourceShared="True" />"
DisplaySettings="visible=True:transparency=0:mime=True:imgFormat=PNG8:height=350:width=600:dpi=96:color=white:transbg=True:displayInToc=True:dynamicTiling=False" Name="AVL" LayerDefinitions=""/>
I need to replace the Name="AVL" with System.Configuration.ConfigurationSettings.AppSettings("AVLLayer") or something close but I can't get the syntext to work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This ended up being ESRI control issue and not asp as I origianlly thought...Thanks for the post though
Well I did answer the question and we certainly could have worked out any config errors had that been the issue. And there seems to be some useful information here from both the asker and myself that belongs in the PAQ.
ASKER
You can have the pts, don't matter to me.. :-)
ASKER
Open in new window