Well, I’ve just built a lovely little HTTP Module that lets us redirect the application pages for a site or site collection to a new master page. I’m quite pleased, to be honest. Anyway, I noticed that the error pages in the site I was testing on were not using my new master page, so I started to examine this. I found that the error page (_layouts/error.aspx) is busy using simple.master. WTF?
It makes sense, I guess. You do need a master page which doesn’t run in an authenticated context, and a brief check shows that this is the master pages for the out-of-box Forms authentication page.
I decided to check out if there were other master pages in Layouts – and there were. My list of master pages is now:
- Default.master – used in normal sites. Often replaced for publishing sites.
- MwsDefault.master – use in Meeting Workspaces. Awkward to replace, but can be done through code or SharePoint designer.
- Application.master – used in ‘administration’ pages, and sometimes pages such as ‘View all site contents’, Recycle bin, and uploading a file.
- Simple.master – used in pages that need to run in an unauthenticated context – such as error pages, or forms authentication pages.
- sspadmin.master – seems to be used editing audiences, in excel services configuration, in profile administration, and handful of other places.
- layouts.master – no idea what this is for. Can’t find where it is used!
- dialog.master – used in the little pop-up dialogs, such as when you’re adding or editing a Hyperlink.
- pickerdialog.master – used in pop-up dialogs such as the web part gallery, or selecting users.
The master pages in italics are comparatively easy to replace; the rest are much more difficult. And try as I might, I couldn’t change the master page for Errors in my HTTP Module. I guess what I’ll do is write another one to redirect errors to my own custom-branded error page.
6 thoughts on “Another day, another master page”
This was a useful post.
Currently I am trying to add a ASPX page into SSP admin web application. All the SSP admin web apps as said uses sspadmin.master.
Will i be able to use the same master page for my ASPX page?
Depends where you’re putting it.
The SSP Site has a default.master – so if you’re putting it into the site, that would be the master page to use.
I am putting my page in SSP and would like to use sspadmin.master. But I am finding difficulties in developing the ASPX page in visual studio.
In case you have done such development can you share the information on how you development new ASPX pages using 3rd party master file in Visual studio.
Hmm. If building pages to go in the SSP site (SPWeb) then I’d use SharePoint Designer, and then copy them out to package into a WSP.
If you’re putting the pages into the _Layouts directory, well, then it’s just normal ASPX development. You could create a website project inside the _layouts directory (in a subfolder!) and chop out the bits you don’t need later. I’ve not tried that though; I rarely have to add pages to the _layouts, and when I do it’s normally only one or two.
What’s the problem you’re having?
What is the benefit(s) of using an HTTP Module to redirect to a new MasterPage as opposed to just replacing the appropriate MasterPage?
Certain master pages (those used by Application pages – all but the top two in the list above) exist in the _layouts directory. Changing those invalidates support from Microsoft; you’re really not supposed to.
Worse, those files are used across your entire farm. Changing those files affects ALL sites in the farm.
For example, one customer of ours had had another party in to do their branding for a particular department. They changed the application.master page in the _layouts directory. Now another department wanted to have some branding (and quite a different one too) – but all of their site settings pages, recycle bin, etc. had the first department’s branding too.
By using an HTTPModule you can redirect requests for those master pages, and you can do so for particular sites, site collections, pages – whatever you choose, really.
There’s a good post about this here: