Programmatically apply a Default Theme in SharePoint

As I’ve mentioned before, I’ve written a brand that is a combination of Theme and Master Page, and is designed to be activated by a feature receiver. When the feature is deactivated, it should restore the previous Master Page and Theme – but it wasn’t doing this for the default theme. Weird.

Well, here’s another good tip from Madalina you have to apply a theme of none, not Default.

web.ApplyTheme("none");

That’s the second tip of hers I’ve found on Google and used in the last 2 weeks. Maybe I should start watching that blog. Anyway, I guess that ‘none’ makes sense when you look in 12/TEMPLATES/LAYOUTS/1033/SPTHEMES.xml – the default theme has a TemplateID of ‘none’.

‘Course my next problem for my feature receiver is that Meeting Workspaces use master pages (MWSDefault.master) that are significantly different to other pages – thanks guys, that’s helpful…

Programmatically apply a Default Theme in SharePoint

2 thoughts on “Programmatically apply a Default Theme in SharePoint

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.