Sharing Master Pages Accross Multipile IIS Applications

I've been searching for a way to share master pages accross multipile IIS applicaitons for a long time. There are several options out there from using the VirtualPageProvider to creating your Master Page in the GAC. I've not had the time to look into any of these options.

What I did find was a very easy solution. Use Virtual Directories.

All you have to do is:

Create a shared location on your web server where the master pages will reside. Dump your shared master page in there.

Add a new virtual directory to your web application via IIS. You can now reference the new virtual directory as though the master page is inside of your web application. Changes made to the global master page will result in the changes being made accrosss the entire set of web projects that you have configured with the master page in the virtual folder.

Easy, quick and works with out much hassle. Just keep in mind that paths are still referenced agianst the content page that is using that master page, so if you have shared images, be sure to set these up in the master page with links that will be able to figure out where the images are regardless of the location of the content page.

0 comments: