【问题标题】:Customize SocialCommentControl in Sharepoint 2010在 Sharepoint 2010 中自定义 SocialCommentControl
【发布时间】:2012-02-06 20:00:49
【问题描述】:

我正在尝试复制社交协作 > 记事板 Web 部件提供的功能,但我不想评论当前页面,而是希望能够评论正在查看的当前列表项。 通过从查询字符串中获取项目 ID,在 Web 部件上呈现的列表项。例如: http://my-site/Pages/default.aspx?ItemId=6dfb7b80-81AA-4e1d-9ba0-4c8c0819c14e&

我尝试嵌入

sharepointportalcontrols:SocialCommentControl id="CommentControl" runat="server"

控制到 webpart 并使用反射设置其 Url(内部属性)。但是在评论时,cmets 仍然与当前页面相反。

如果有任何人这样做过,请告诉我是否有办法实现此功能。

谢谢。

【问题讨论】:

    标签: sharepoint-2010 comments social


    【解决方案1】:

    Relized 评论控件会回发一个表单,而我没有在 Postrback 上设置 Url。一旦我移动了我的数据绑定代码,它就会在回发时发生,并且 cmets 也开始工作了。

    标记:

    <SharePointPortalControls:SocialCommentControl ID="comments" runat="server" />
    

    后端:(在转发器项目数据绑定内)

    SocialCommentControl commentsControl = (SocialCommentControl) e.Item.FindControl("comments");
    
                if (commentsControl != null)
                {
                    commentsControl.SetProperty("AllowNewComment", true);
                    commentsControl.SetProperty("DisplayItems", 5);
                    commentsControl.SetProperty("Uri", new Uri(itemUrl));
                }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-20
      • 2011-07-02
      • 2011-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-14
      相关资源
      最近更新 更多