I'm working on rating feature for our SharePoint application. I have a custom list something like below: ex.

UserId -- Title -- JobId -- Rating(0-5) -- Number of Ratings

UserId & JobId together makes unique key.

Basically, I have to read rating values and create aggregate and display in UI. So, in my application page I need to read these 'Rating' & 'Number of Ratings' field values.

Can any one please suggest how to do this?

2 Answers 2


In order to retrieve the rating for list item use the following method:

public SocialRating GetRating(
    Uri url

exposed by class SocialRatingManager

To construct Uri for the list item the following code could be used:

var itemUrl = new Uri(SPUrlUtility.CombineUrl(web.Url, item.Url));

The following example demonstrates how to retrieve Social Ratings for list item:

private static SocialRating GetListItemSocialRatings(SPWeb web, SPListItem item)
    var context = SPServiceContext.GetContext(web.Site);
    var socialRatingManager = new SocialRatingManager(context);

    var itemUrl = new Uri(SPUrlUtility.CombineUrl(web.Url, item.Url));
    return socialRatingManager.GetRating(itemUrl);

Once you have URI of the item, it's easy to read rating for a list item. Check the link below



SocialRatingManager Members

  • This one is good. Could you suggest me how to find/get the uri for items in a custom list. Commented Jan 30, 2012 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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