2013-09-26 28 views
0

有誰知道是否有方法使用SharePoint 2013訪問自定義Web部件中的博客文章?我訪問過這樣的列表:使用SharePoint 2013從自定義Web部件中的博客中讀取

SPSite site = new SPSite("http://site/sites/publish/Lists"); 
SPWeb web = site.OpenWeb(); 
SPList list = web.Lists["Research Publications"]; 

但我沒有看到SPBlog或類似的博客對象。

回答

0

您有權限訪問?

您正在使用沙盒嗎?

沙箱不reat外部基地..

+0

我可以完全訪問所有內容,並且Web部件作爲服務器場解決方案部署。 – Fenoec

+0

然後我不能幫你:( –

0

哦,杜。博客中的實際帖子只是一個列表,我可以直接使用SPSite連接到博客,因爲它是一個子站點...所以這段代碼從我的「公告」博客子站點抓取帖子。

SPSite site = new SPSite("http://site/sites/publish/announcements"); 
SPWeb web = site.OpenWeb(); 
SPList posts = web.Lists["Posts"]; 
相關問題