Reputation:
I have a virtual directory inside of my main virtual directory in IIS.
can i reference the parent application and reference its master page? If yes, how?
Upvotes: 1
Views: 1611
Reputation: 233
Much to my surprise this is possible-- if you make a virtual directory which points back to your master page folder in the parent application. E.g.:
With this setup, this can work in your child web.config:
<pages masterPageFile="~/Master/Default.master">
I assume that references to other master pages in the @Page directive will work, but I have not tried it.
Upvotes: 1
Reputation: 84784
For all intents and purposes, no it's not possible. ASP.NET will not execute an ASPX/ASCX/MASTER outside of it's AppDomain. I recommend you go down a different route with your solution (compiled into a common dll, for example)
Edit: One potential question to ask is whether you need a virtual directory or not. What is it that made you chose to separate them in the first place?
Beyond that, you could possibly fake it by writing your own virtual path provider, but that would lead to a world of hurt (with the base classes not being compiled, etc).
I recommend you go for the simplest solution possible.
Upvotes: 2