Asked by:

Programmatically Change Theme of SPWeb

Question

How do you programmatically change the theme on an SPWeb? For whatever reason the following code (which works in a feature receiver) isnt working on established sites.

web.ApplyTheme("Jet");
web.Update();

Please note Jet isnt the theme I want but even it doesnt work Also note that the version of sharepoint I'm working with appears to be in the very early alpha stage of development, so please keep that in mind when suggesting solutions

All replies

nevermind... apparently the solution is to not use the same spweb instance that you used to make a master page change. create a new spweb and only use it for the theme change. or maybe do the theme change first.

I am trying to involve someone familiar with this topic to further look at this issue.

Thanks,
Rock Wang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.