Here is some code I'm currently using to set my Masterpage as the default Masterpage within my site. I'm running into a problem where I receive the onQuerySucceeded message after deploying the App. However, the Masterpage on the site does not update to the one specified within my App.
var context;
var web;
var user;
function sharePointReady() {
updateMaster();
}
function updateMaster() {
var clientContext = new SP.ClientContext.get_current();
this.web = clientContext.get_web();
this.web.set_masterUrl('/NavigationList/MasterPages/BootstrapTest.master');
clientContext.load(this.web);
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)
);
}
function onQuerySucceeded(sender, args) {
alert('New Master Page set to: ' + this.web.get_masterUrl());
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
I have the permissions of the web and the site collection set to full control.
Any help would be appreciated.
0 commentaires:
Enregistrer un commentaire