2013-08-19 31 views

回答

1

它被轉移到SharePoint可同時經由appredirect.aspx重定向創建POST請求。因此,獲取Site Logo Url的唯一方法就是處理appredirect POST請求。

要啓動重定向你應該使用這個代碼片段:

Response.Redirect(TokenHelper.GetAppContextTokenRequestUrl(sharePointHostUrl, Server.UrlEncode(targetUrl))); 

ContextToken,SiteLogo,URL,標題等可以在POST FORMDATA被發現。

1

根據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 SDKSharePoint 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)); 
});