DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 08 Aug 2007 09:22:46 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    unknown
          2    Peter Bromberg [C# MVP]


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#.
Date:Wed, 08 Aug 2007 09:22:46 -0700   Author:  

RE: web.config to hold control specific variables   
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/aspnet/e54f2d32-72c4-4d2b-b180-c1f564b41f85/some-aspnet-20-configur.aspx

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



"mattgarvin@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#.
> 
> 
Date:Wed, 8 Aug 2007 10:46:07 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us