【问题标题】:Reading from a blog in a custom web part using SharePoint 2013使用 SharePoint 2013 从自定义 Web 部件中的博客读取
【发布时间】:2013-10-02 20:02:37
【问题描述】:

有谁知道是否可以使用 SharePoint 2013 访问自定义 Web 部件中的博客文章?我访问过这样的列表:

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

但我没有看到 SPBlog 或类似的博客对象。

【问题讨论】:

    标签: sharepoint blogs web-parts sharepoint-2013


    【解决方案1】:

    您有访问权限吗?

    您在沙盒中?

    沙盒不处理外部基地..

    【讨论】:

    • 我拥有对所有内容的完全访问权限,并且 Web 部件被部署为场解决方案。
    • 那我帮不了你:(
    【解决方案2】:

    哦,呵呵。博客中的实际帖子只是一个列表,我可以直接使用 SPSite 连接到博客,因为它是一个子站点……所以这段代码从我的“公告”博客子站点中获取帖子。

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

    【讨论】:

      猜你喜欢
      • 2013-10-02
      • 2015-08-02
      • 2014-07-09
      • 1970-01-01
      • 2013-09-23
      • 2012-01-20
      • 1970-01-01
      • 1970-01-01
      • 2016-05-22
      相关资源
      最近更新 更多