views:

42

answers:

2

I have an app that contains different "skins", and most of these skins share the same images. For each skin, we have been creating a copy of the image directory, just in case one of the files is different.

Is there something like object oriented inheritance for an IIS directory? Meaning if a file exists, use it, otherwise pull the file from a parent directory?

Let's say my parent image folder has A.png, B.png and C.png. My "skin" image folder has just A.png.

I want to reference this from my web app so that I get the skinned A.png, but the parent B.png and C.png.

I'm guessing no, so is there a way I could replicate this in ASP.net?

+1  A: 

You can create your own ASP:IMAGE control by sub-classing Image that knows how to check a certain inheritance structure to find the image.

rick schott
A: 

One option may be using ASP.NET MVC to resolve those routes on the server-side to a particular physical files, possibly using a combination of System.File.IO.Exists to check at each "level" of the path for the overriding file, and RewritePath once it is found.

richardtallent