Changing Master Page in WebApp in WSS

Joined
Nov 9, 2009
Messages
1
Reaction score
0
Hello there,

I am trying to change the master page of a webapp created in WSS, so I have to do this in a winform, and I tried this method:

C#
public void mSetMaster(string sUrlSite, string sWebName)
{
using (SPSite oSiteCollection = new SPSite(sUrlSite))
{
SPWeb myWebSite = oSiteCollection.OpenWeb(sWebName);
myWebSite.MasterUrl = "/_layouts/BlackBand.Master";
myWebSite.CustomMasterUrl = "/_layouts/BlackBand.Master";
myWebSite.Update();
}
}

In theory it works, but when i try to open the webapp it only says "Error" so, could anyone give me a hand???

Thank you
Nelson:withstup:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top