views:

28

answers:

1

I have a custom control that I declare like:

<hello:someControl id="asdf" />

Now I need to access a config setting in the web.config's appsetting and give access to it to the control.

I want to pass this value using the attribute.

How can I do this?

A: 

Have you already tried accessing the configuration setting from the control's code behind?

string mySetting = "";
if(ConfigurationManager.AppSettings["mySetting"] != null)
     mySetting = ConfigurationManager.AppSettings["mySetting"].ToString();
jdecuyper