【问题标题】:Sharepoint sandbox solution doesn´t work in Office 365Sharepoint 沙盒解决方案在 Office 365 中不起作用
【发布时间】:2012-02-26 03:04:25
【问题描述】:

我已经构建了一个沙盒 webpart 解决方案,它贯穿当前 web 的所有组并显示已定义组的所有成员。在我本地的 SharePoint 2010 实例中,webpart 完全按照它应该做的,但在云中我没有输出。我尝试过显示所有可用的组,但 webpart 也没有显示任何内容,我的代码有什么问题?

protected override void RenderContents(HtmlTextWriter writer)
{
    base.RenderContents(writer);

    foreach (string name in GetGroupMembers())
        writer.Write(name);
}

public StringCollection GetGroupMembers()
{
    StringCollection groupMemebers = new StringCollection();
    SPGroupCollection groups = SPContext.Current.Web.Groups;

    //for each item in the collection of groups
    foreach (SPGroup group in groups)
        //display all users from the defined group
        if (group.ToString().Equals(DEFINED_GROUP))
            foreach (SPUser user in group.Users)
                groupMemebers.Add(user.Name);

    return groupMemebers;
}

【问题讨论】:

    标签: sharepoint sharepoint-2010 web-parts sandbox office365


    【解决方案1】:

    解决了:

    SPGroupCollection groups = SPContext.Current.Site.RootWeb.Groups;
    

    在我本地的 SharePoint 中,我只在根网站中测试过。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-09
      • 1970-01-01
      • 2011-11-20
      • 2011-06-01
      • 1970-01-01
      • 2013-12-02
      • 2015-05-07
      相关资源
      最近更新 更多