Ben Shoemate
Ben Shoemate

Reputation: 121

How can I list the current users audiences in sharepoint 2010?

In Sharppoint 2010 have a webpart that works off audiences to target content to users in a global portla (content comes form all over) how can I give users the ability to see which audience they are currently in?

Why? For usability, I would like to add a link that shows the audiences the user currently belongs to so they can understand why they see what they see in the list.

Upvotes: 0

Views: 1239

Answers (1)

Rony SP
Rony SP

Reputation: 2628

AudienceLoader objAudLoader = AudienceLoader.GetAudienceLoader();
    AudienceManager.IsCurrentUserInAudienceOf(objAudLoader, audience, false)

The AudienceLoader belongs to Microsoft.Office.Server.Audience namespace and documented here: http://msdn.microsoft.com/en-us/library/microsoft.office.server.audience.audiencemanager.iscurrentuserinaudienceof.aspx

Hope this is helpful for you..

Upvotes: 1

Related Questions