0

I want to make a button Like it in Sharepoint 2010 to visible for everybody on the Intranet Site could see, and everybody could push this button and see how many person like it. How I Could do it on the List and Count a element that user liked?

1

There is already a "Like" button, have a look at this question
"I Like It" button on Sharepont 2010

So you already have that functionality, you can programmatically access these RATINGS as well..

Uri uri = new Uri("https://servername.com/finance/Finance/");

using (SPSite site = new SPSite("https://servername.com/finance/Finance/"))
{
   // Get the context of the service application
   SPServiceContext context = SPServiceContext.GetContext(site);

   // SocialTagManager - Contains methods and properties used to manipulate social tag data
   SocialTagManager socialTagManager = new SocialTagManager(context);

   // GetTags(Uri) method is used to retrieve an array of SocialTag objects that are owned by the current user and that contain the specified URL.
   SocialTag[] tags = socialTagManager.GetTags(uri);  
}

Add reference to "Microsoft.Office.Server.UserProfiles.dll", and using Microsoft.Office.Server.SocialData; to be able to use SocialTagManager class

You can create a custom control which shows a count of Likes at the top of each page (maybe include this control in custom MasterPage)

Sources

Programmatically get all the Social Tags for the specified URL in SharePoint 2010

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.