473,379 Members | 1,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Accessing Web.Config from design mode in VS.NET

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?

--
Patrik Löwendahl
cshrp.net - 'Elegant code by witty programmers'
cornerstone.se - 'IT training for proffesionals"
Nov 18 '05 #1
4 1540
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

al*****@yahoo.com
Nov 18 '05 #2
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

al*****@yahoo.com
Nov 18 '05 #3
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" <an*******@discussions.microsoft.com> wrote in message
news:B5**********************************@microsof t.com...
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.
al*****@yahoo.com

Nov 18 '05 #4
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" <an*******@discussions.microsoft.com> wrote in message
news:B5**********************************@microsof t.com...
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.
al*****@yahoo.com

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bucky | last post by:
I am calling a C# method/DLL from Reporting Services. In the DLL, I am referencing ConfigurationSettings.AppSettings. This should go in app.config in the caller's folder. This is fine when the...
3
by: Simon Harvey | last post by:
Hi chaps, Can someone direct me to the necessary class that will allow me to write information into my applications .config file? I know how to read information but I'm sure there must be a way...
7
by: Chris Clement | last post by:
I have been handed a project that someone else started and most of it was developed in the VS.NET design mode. For whatever reasons, when I try to make changes to the controls in VS.NET design...
2
by: hazz | last post by:
I don't get it. I have a VS2005 solution with a web service project and a windows project. The web service when tested on its own works fine. But when I add it as a web reference and refer to it my...
2
by: Patrik Löwendahl | last post by:
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. ...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
6
by: garyjefferson123 | last post by:
I'm having a scoping problem. I have a module called SpecialFile, which defines: def open(fname, mode): return SpecialFile(fname, mode) class SpecialFile: def __init__(self, fname, mode):...
0
by: le0 | last post by:
hi guys can you help me with this, this is my first time to published a website to another server and access it using my browser but this runtime error always appears. Server Error in...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.