L
Luke Dalessandro
I have an application with the following layout
/root/
/root/Default.aspx
/root/web.config
/root/child/
/root/child/web.config
web.config has a custom configuration section "testSection" with the
basic layout of:
<testSection>
<tests>
<add id="" value="" />
</tests>
</testSection>
The root web.config defines:
<testSection>
<tests>
<add id="test1" value="root1" />
<add id="test2" value="root2" />
</tests>
</testSection>
the child web.config defines:
<testSection>
<tests>
<remove id="test2" />
<add id="test2" value="child2" />
<add id="test3" value="child3" />
</tests>
</testSection>
finally, the root web.config defines the url mapping:
<urlMappings enabled="true">
<add url="~/root/child/Default.aspx"
mappedUrl="~/root/Default.aspx"/>
</urlMappings>
Essentially, my goal is, for the url "~/root/child/Default.aspx", I want
to run the file "~/root/Default.aspx" BUT, I want it run as if were
located at "~/root/child/Default.aspx", inheriting the child defined
web.config.
Can someone point me towards the solution? As it is now, the page gets
run as if it were located where it is actually located, and no
web.config accumulation is done. Presumably I either need a way to
manually load configuration files before the Rewrite happens, or I need
a way to execute a .aspx class as if it were located at a different
location. I imagine that the first way is the better way to go, as
everything else (urls etc) should be processed as if the file were
executing at it's actual location.
I just need a starting point. I have written custom url mapping
modules, but nothing I know how to do will allow me to solve my problem.
Thanks in advance,
Luke
/root/
/root/Default.aspx
/root/web.config
/root/child/
/root/child/web.config
web.config has a custom configuration section "testSection" with the
basic layout of:
<testSection>
<tests>
<add id="" value="" />
</tests>
</testSection>
The root web.config defines:
<testSection>
<tests>
<add id="test1" value="root1" />
<add id="test2" value="root2" />
</tests>
</testSection>
the child web.config defines:
<testSection>
<tests>
<remove id="test2" />
<add id="test2" value="child2" />
<add id="test3" value="child3" />
</tests>
</testSection>
finally, the root web.config defines the url mapping:
<urlMappings enabled="true">
<add url="~/root/child/Default.aspx"
mappedUrl="~/root/Default.aspx"/>
</urlMappings>
Essentially, my goal is, for the url "~/root/child/Default.aspx", I want
to run the file "~/root/Default.aspx" BUT, I want it run as if were
located at "~/root/child/Default.aspx", inheriting the child defined
web.config.
Can someone point me towards the solution? As it is now, the page gets
run as if it were located where it is actually located, and no
web.config accumulation is done. Presumably I either need a way to
manually load configuration files before the Rewrite happens, or I need
a way to execute a .aspx class as if it were located at a different
location. I imagine that the first way is the better way to go, as
everything else (urls etc) should be processed as if the file were
executing at it's actual location.
I just need a starting point. I have written custom url mapping
modules, but nothing I know how to do will allow me to solve my problem.
Thanks in advance,
Luke