Accessing Web.Config from design mode in VS.NET

  • Thread starter Thread starter Patrik Löwendahl
  • Start date Start date
P

Patrik Löwendahl

Hi,

I'm trying to build a server control with a custom designer. I would like it
to get information from the web.config file when working with the control in
design time in Visual Studio.NET.

Specifically, I've registrerd a custom web.config section with information
used to render the server control.

How do one go about to read it?
 
Use the ConfigurationSettings object e.g

Dim myDBConnectionString As String = ConfigurationSettings.AppSettings("DBConnection"

where the "DBConnection" variable (or whatever you want to store) is held in the "appsettings" tag of your web.config

(e-mail address removed)
 
Well that works fine from runtime, but it doesn't trigger in designtime

also it's not an appsetting I'm retreiving, it's a custom web.config section

// Patrik

alaspin said:
Use the ConfigurationSettings object e.g.

Dim myDBConnectionString As String = ConfigurationSettings.AppSettings("DBConnection")

where the "DBConnection" variable (or whatever you want to store) is held
in the "appsettings" tag of your web.config.
 
Back
Top