In .NET 2.0 and later, you can create and add a master page in your web application to give a common look and feel in all the web pages across the application. For example you can make a master page and put the application header and footer, all the common Javascript, css files etc in it; then rest of the web pages can be master page’s content pages and will automatically get and share the same functionality. This feature works perfect but what if you work in a corporate where instead of having one big giant enterprise level application you have a number of small, easy-to-handle web applications and you want a common shared master page for all of them? So in other words, we know a master page can be shared among different web pages in the same application, but can it be shared among pages of different web applications as well?

The answer is Yes, and No; a master page can be shared across different web applications but to what extent and at what cost and effort, is questionable. In order to achieve this functionality, there are 3 ways:

And I discovered one or two other ways as well that are basically combinations of the above basic patterns. Each of the above approaches has its own pros and cons and you have to decide which pros are important for you and which cons you can live with. Let’s see each of them in detail and let’s get started with the first one, virtual directories.

Before we start actual work, please understand following two terminologies that I’ll use in these tutorials:

‘Master page project’ means: The project which has the master page and is shared by some other web applications.

‘Client web application’ means: The project which is having the reference of master page project and is sharing master page with some other client web apps.