Re: Custom Configuration Sections in Location Tag
- From: "David Williams" <david.williams@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 3 Oct 2008 08:47:38 -0400
By virtual location I mean that in my web.config I need to set something
simular to this:
<configuration>
<configSections>
<add name='customSectionGroup" ...>
</configSections>
<customSectionGroup>
<customSection>
<customOption />
</customSection>
</customSectionGroup>
<location path="someVirtualDirectory">
<customSectionGroup>
<customSection>
<customOption />
</customSection>
</customSectionGroup>
</location>
</configuration>
Then in our web site, have the option(s) set in the <customSectionGroup> be
in effect all of the site save within ~/someVirtualDirectory, where I need
the option(s) in the <location><customSectionGroup> tag to be in effect.
I know how to write the code to read the default <customSectionGroup>.
However, getting the information from within the
<location><customSectionGroup> is currently baffling me.
I hope that this makes more sense.
David
"Michael Nemtsev [MVP]" <nemtsev@xxxxxxx> wrote in message
news:900895ec719858caf34952ffe440@xxxxxxxxxxxxxxxxxxxxxxx
Hello David,
Could you explain in details what u mean with "virtual location" for
config files.
Did you try to create external config and refer to in from you main
webconfig?!
---
WBR, Michael Nemtsev [Microsoft MVP] :: blog:
http://spaces.live.com/laflour :: http://twitter.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
DW> I am familiar with creating custom configuration settings and
DW> accessing them. However, for a current requirement, I need to
DW> control the various settings in my custom configuration section by
DW> virtual location of the pages accessing the configuration
DW> information. The best way that I know is to do this via the use of
DW> the location tag in the web.config.
DW> DW> However, I can not seem to get the correct instance of the
DW> configuration section in my configuration class. What is the
DW> correct method for retrieving the current configuration based on the
DW> virtual location?
DW> DW> David
DW>
.
- Follow-Ups:
- Re: Custom Configuration Sections in Location Tag
- From: John Saunders
- Re: Custom Configuration Sections in Location Tag
- References:
- Custom Configuration Sections in Location Tag
- From: David Williams
- Re: Custom Configuration Sections in Location Tag
- From: Michael Nemtsev [MVP]
- Custom Configuration Sections in Location Tag
- Prev by Date: How to relate a SQL based entity with an Object based entity in Entity Framework
- Next by Date: Re: session variables being lost
- Previous by thread: Re: Custom Configuration Sections in Location Tag
- Next by thread: Re: Custom Configuration Sections in Location Tag
- Index(es):
Relevant Pages
|