Sharepoint 沙箱解决方案在 Office 365 中不起作用
我构建了一个沙箱 Web 部件解决方案,该解决方案运行当前 Web 的所有组并显示已定义组的所有成员。在我的本地 SharePoint 2010 实例中,Web 部件完全执行其应有的操作,但在云中我没有输出。我尝试过显示所有可用组,但 Web 部件也没有显示任何内容,我的代码有什么问题吗?
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;
}
I have build a sandbox webpart solution that runs through all groups of the current web and displays all members of the defined group. In my local SharePoint 2010 instance the webpart does exactly what it should but in the cloud i have no output. I have tried do display all available groups but the webpart also shows nothing, what is wrong with my code?
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方法:
在我的本地 SharePoint 中,我只在根 Web 中测试了它。
Solved it with:
In my locals SharePoint I have only tested it in the root web.