问题非常明确,我知道如何从c#
中的属性包中读取属性但现在我需要知道如何在jquery或SPServices中执行此操作。有什么想法吗?
由于
答案 0 :(得分:-2)
var webProperties;
function getWebProperties() {
var clientContext = new SP.ClientContext.get_current();
webProperties = clientContext.get_web().get_allProperties();
clientContext.load(webProperties);
clientContext.executeQueryAsync(function.createDelegate(this, this.getPropertyBagSuccess), function.createDelegate(this, this.getPropertyBagFail));
}
function getPropertyBagSuccess() {
var propertyBag = webProperties.get_fieldValues();
if(propertyBag.YourProperty != undefined)
{
alert(propertyBag.YourProperty);
}
else
{
alert("property not found!");
}
}
function getPropertyBagFail(args, sender)
{
alert("error trying to read propertybag");
}