R
Rob Mayo
I'm developing a server control for our intranet. This control is only going
to be used in two applications on the server, but they must be separate.
It has been established that these 2 apps will use a specifically named key
from their respective web.config's. I want the control to use that key
regardless of which application it's being used on.
How can I get that key from the application?
I considered creating a config file for the control, but that would be more
to maintain. We're using config files, because we don't want to use the
registry anymore. So the registry's out.
for example
visual basic
code:-----------------------------------------------------------------------
-------'In the app
Dim strConn As String = ConfigurationSettings.AppSettings.Item("EQDB")
'I want (in the control)
Dim strConn As String =
CallingApp.ConfigurationSettings.AppSettings.Item("EQDB")-------------------
-----------------------------------------------------------
I could pass in the values I want directly from the app(s), but that would
mean I would have to do that for every page in the app(s) that wanted to use
the control. That would be a maintenance nightmare.
I'm developing for developers, so I want them to be able to use this control
with as little hassle as possible.
Any ideas as to how to get this?
to be used in two applications on the server, but they must be separate.
It has been established that these 2 apps will use a specifically named key
from their respective web.config's. I want the control to use that key
regardless of which application it's being used on.
How can I get that key from the application?
I considered creating a config file for the control, but that would be more
to maintain. We're using config files, because we don't want to use the
registry anymore. So the registry's out.
for example
visual basic
code:-----------------------------------------------------------------------
-------'In the app
Dim strConn As String = ConfigurationSettings.AppSettings.Item("EQDB")
'I want (in the control)
Dim strConn As String =
CallingApp.ConfigurationSettings.AppSettings.Item("EQDB")-------------------
-----------------------------------------------------------
I could pass in the values I want directly from the app(s), but that would
mean I would have to do that for every page in the app(s) that wanted to use
the control. That would be a maintenance nightmare.
I'm developing for developers, so I want them to be able to use this control
with as little hassle as possible.
Any ideas as to how to get this?