我發現了SPWeb.SiteLogoUrl,並期望CSOM和REST中有此屬性。但我沒有找到它。我如何使用CSOM或REST獲取SiteLogoUrl?凡在CSOM一個SiteLogoUrl?
Microsoft.SharePoint.Client.dll
我發現了SPWeb.SiteLogoUrl,並期望CSOM和REST中有此屬性。但我沒有找到它。我如何使用CSOM或REST獲取SiteLogoUrl?凡在CSOM一個SiteLogoUrl?
Microsoft.SharePoint.Client.dll
它被轉移到SharePoint可同時經由appredirect.aspx重定向創建POST請求。因此,獲取Site Logo Url的唯一方法就是處理appredirect POST請求。
要啓動重定向你應該使用這個代碼片段:
Response.Redirect(TokenHelper.GetAppContextTokenRequestUrl(sharePointHostUrl, Server.UrlEncode(targetUrl)));
ContextToken,SiteLogo,URL,標題等可以在POST FORMDATA被發現。
根據UserVoice driving improvements to SharePoint API微軟發佈SharePoint 2013 and SharePoint Online solution packs包含以下變化現有的API:
Web
對象公開通過CSOM(.NET,REST,JS)AlternateCssUrl
財產
或者你可以安裝最新版本的SharePoint Server 2013 Client Components SDK或SharePoint Online Client Components SDK
個例子
如何更新Web.AlternateCssUrl
財產使用CSOM:
using (var ctx = new ClientContext(webUri))
{
ctx.Web.AlternateCssUrl = "/SiteAssets/Contoso.css";
ctx.Web.Update();
ctx.ExecuteQuery();
}
如何獲得Web.AlternateCssUrl
財產使用REST:
$.getJSON(_spPageContextInfo.webAbsoluteUrl + "/_api/web")
.done(function(data)
{
console.log(data.AlternateCssUrl);
})
.fail(
function(error){
console.log(JSON.stringify(error));
});