Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I 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? 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.

In sharepoint 2010 BTW

share|improve this question

1 Answer 1

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

you also see this link: http://blogs.prexens.com/pages/category.aspx?Name=Audiences

Hops this helps

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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