locked
get values from web.config to .aspx RRS feed

  • Question

  • Hi,

    partial code in the web.config file goes like this:

      <appSettings>
             <add key="my_key" value="key_value" />
      </appSettings>

    Now, I want to get the value in my .aspx

    I know that this can be done through the code behind (by ConfigurationManager.AppSettings["my_key"].ToString())
    but I want that from the .aspx

    I have tried <%$ appSettings:my_key%> but that didn't work

    Please let me know if there is any other solution or not.

    Thanks in advance

    Supradip

    • Moved by Harry Zhu Thursday, September 24, 2009 8:34 AM I'm moving the thread relating to asp.net (From:Visual C# Language)
    Tuesday, September 22, 2009 2:22 PM

Answers

  • You can put C# code in the aspx page instead of the code behind, I believe that's why alot of people call C# a scripting (capable) language.  This question should be asked in the asp.net forum.
    おろ?
    Tuesday, September 22, 2009 2:36 PM