473,395 Members | 1,675 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,395 software developers and data experts.

web.config to hold control specific variables

Hello,
my company hosts many websites, and we want to add a Feedback Form
(like "Contact Us") that can be re-used on all of them just by
"dropping in" a new directory containing the code. My boss told me to
make it as modular as possible, and to make it a control we can just
drag on to a page. Then he went on vacation for a week. :)

I have been reading about web.config files, and thought I could
utilize one to contain the few items that will be site specific (like
where the style sheet is, and a few different questions unique to a
particular Feedback Form) which I could stick in the "AppSettings"
area of a "web.config" that I put in the directory containing the rest
of my code. That is, I was hoping to not have to modify each site's
Web.config, but instead employ my own in my own folder.

Yes, I am new to ASP.NET, and could be mis-interpreting things, but
the book I have been reading did make it seem like this was possible.
But I do not see how to do it. When I try to put my own web.config in
my own directory, it seems to be ignored. Or maybe I just don't know
the way to access its "AppSettings" keys which I have defined?

Thanks for any help that you can provide.

Matt G.
PS: I am using Visual Studio and programming this in C#.

Aug 8 '07 #1
1 3025
Matt,
web.config is read at the application root folder level. So if you have a
subfolder that has your subfolder containing additional pages/ code and it is
not marked as an Application in IIS, then the web.config from the folder
above it will take precedence. You can however specify a file= atribute in
the main web.config's appSettings section and it will read your custom
appSettings as long as the file= attribute correctly points to your settings
include file.

See here for a short article on same:
http://www.eggheadcafe.com/tutorials...-configur.aspx

--Pete
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"ma********@hotmail.com" wrote:
Hello,
my company hosts many websites, and we want to add a Feedback Form
(like "Contact Us") that can be re-used on all of them just by
"dropping in" a new directory containing the code. My boss told me to
make it as modular as possible, and to make it a control we can just
drag on to a page. Then he went on vacation for a week. :)

I have been reading about web.config files, and thought I could
utilize one to contain the few items that will be site specific (like
where the style sheet is, and a few different questions unique to a
particular Feedback Form) which I could stick in the "AppSettings"
area of a "web.config" that I put in the directory containing the rest
of my code. That is, I was hoping to not have to modify each site's
Web.config, but instead employ my own in my own folder.

Yes, I am new to ASP.NET, and could be mis-interpreting things, but
the book I have been reading did make it seem like this was possible.
But I do not see how to do it. When I try to put my own web.config in
my own directory, it seems to be ignored. Or maybe I just don't know
the way to access its "AppSettings" keys which I have defined?

Thanks for any help that you can provide.

Matt G.
PS: I am using Visual Studio and programming this in C#.

Aug 8 '07 #2

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

Similar topics

2
by: will taubin | last post by:
i would like my program to have a config.php with passwords and other stuff. i would like to have a functions.php to hold all my functions. i would like the functions.php to include/require...
4
by: Jeffrey Palermo [MCP] | last post by:
I use web.config files in many directories, and my aspx files can access the AppSettings. If I have a subdirectory Foo with an aspx, and Foo has a local web.config that defines an AppSetting. My...
6
by: Luis Esteban Valencia | last post by:
Hi, I want in debug mode debug=true. In release (production), no reason debug to be true but the questions are: 1. Does it slow the application (holding debug=true) 2. If yes, how can I solve...
2
by: John Wildes | last post by:
hello I was wondering if someone could point me in the direction of information on using app.config to store string variables. I have a couple of variables that store path information for file...
0
by: Lopamudra | last post by:
Hi, I have a doubt: Any key defined in the "appsettings" section of the web.config file is global to the application. Each time the web.config is changed, the application restarts. Both...
2
by: mocsoft | last post by:
I have an application that requires the dynamic changing of values in the web.config file, I have code that seems to change the value: WebConfigurationManager.AppSettings("database") =...
2
by: Griff | last post by:
Hi Bit confused about how to read a connection string from my web.config...I need to hold this data in a particular section (v2.0 specific). Extract from web.config:...
1
by: teo | last post by:
I put some variables in a web.config file I have a global.asax file that needs to use one of those variables How can global.asax read that value? If I have more than one web.config ...
10
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
This has been working perfectly for months. Since we switched from ASP.NET 1.1 to 2.0, we have constant and sporadic issues with updating our applications. Touching the web.config works about...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.