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:
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: