Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Getfeed from teamsite(not personalsite)

$
0
0

Hi

i made webpart this is get newfeed and insert label.

I want to obtain a newsfeedsite http://nar-cla500s3:2222/(this is team collectionsite)

but Currentnewsfeedtogettheloginuserof the personal site.

using (SPSite site = new SPSite("http://nar-cla500s3:2222/"))
            {
                SPServiceContext context = SPServiceContext.GetContext(site);
                using (new SPServiceContextScope(context))
                {
                    SPSocialFeedManager sfm = new SPSocialFeedManager();
                    SPSocialFeedOptions options = new SPSocialFeedOptions();
                    options.SortOrder = SPSocialFeedSortOrder.ByCreatedTime;
                    options.MaxThreadCount = 1;
                    var aaa = sfm.GetFeed(SPSocialFeedType.News, options);
                    SPSocialThread thread = aaa.Threads[0];
                    Label1.Text = thread.RootPost.Text;
                }    
            }       

i need help, Thank you


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>