Wednesday, March 28, 2012

sub-web.config

ok, i have a web.config in my main solution directory and i have a web.config in a subdirectory. the only other files in the subdirectory are web user controls, but i would like the web.config in there to be used, as well as the web.config in the main solution directory.

is this possible? I'm not calling any aspx files from the subdir, just using the web user controls from there in other aspx's.

matt.

I don't know, I would think not, because the user controls would be a control in the pages control tree, and such, would probably use the main web.config. Only pages I believe would use a sub web.config.

Just try it out to see if it works.

Personally I think that user controls are merged with your page and so the user controls runs in the web.config of that folder where the webform resides. Of course, I could be wrong on that one because I didn't test it.

Grz, Kris.


http://weblogs.asp.net/pwilson/archive/2003/04/09/5261.aspx

I see that it can be done. But I can't get it to work - my .NET just doesn't appear to read the subconfig file. My code looks just like in the page linked above!


The link you provided explains how to put configuration data in an external config file (YourSettings.config) and link to that file from the web.config. It has nothing to do with your original question.

Grz, Kris.


yes it does; it's one potential solution...

"i would like the web.config in there to be used, as well as the web.config in the main solution directory"

if it can be made to work.

i'm not going to *** semantics here - what i'm looking for, now, is how to get this apparently wonderful appSettings attribute to work.

0 comments:

Post a Comment