Hot answers tagged audience-targeting
4
No matter how you do it it's going to be a major headache when you're only limited to SharePoint Foundation. You don't have any advanced out of the box user/audience control with SharePoint Foundation.
When you insert webparts, to avoid heavy load on the page, set them to hidden right after you insert them on the page. That way they are already hidden and ...
3
AudienceID is an internal field set by SharePoint. You can't set it, but you can retrieve it if it has been saved to the db.
What is your requirement that means you have to control the audience ID? Typically you would retrieve Audience by name. If you need to you can then access the AudienceID value.
Hope that helps.
2
To my knowledge you do not add User to an Audience, but rather build rules that would include the respective user to an audience.
Creating rule based Audiences is available here http://msdn.microsoft.com/en-us/library/ms498178
Then you could check is user is part of an Audience in a particular Web, see here http://msdn.microsoft.com/en-us/library/ms500775
2
As Kishork noted, this particular issue was related to a custom audience filter. Just wanted to add that we've seen this same issue several times in our Sharepoint 2010 environment after using Metalogix to move content, or running various jobs. The initial symptom is the same - the target audience property isn't visible when editing a web part.
Running ...
2
Please refer link below link Mr. Raju
http://social.technet.microsoft.com/Forums/da/sharepoint2010programming/thread/181fdb91-b16d-4e51-a9a4-454c8ad1c374
You will find that it is not possible because SharePoint manages GUID internally. so you can not assign it. in some cases it is possible but in your case it is not possible.
1
I would have your code that you have above within all the webparts!
if (boolThisTypeOfUser) // needs particular webparts
{
//createchildcontrols as normal
}
can you see where im getting to? this way it knows to show the webpart by carrying on with the code within the createchildcontrols! otherwise dont do anything!
Your also getting rid of the ...
1
Actually the best option is to use the Security Trimming controls, as in http://fusionovation.com/post/2008/09/18/security-trimmed-controls-in-sharepoint.aspx
As you would immediately realize is they do not support SPGroups, so find here a solution doing exactly this http://www.dhirendrayadav.com/2011/08/extending-sharepoint-security-trimmed.html
I find it ...
1
Design the ascx carefully, the portion you want to show/hide declare the part as runat="server", example -
<table>
<tr id="trShowHide1" runat="server">
//some content
</tr>
<tr id="trShowHide2" runat="server">
//some content
</tr>
</table>
and in CreateChildControls() event (or if you think any other event ...
1
I was able to do this. I created a custom stored procedure (by copying and modifying the one used by the API to create audiences) to create the audience with the GUID I needed. Look at the ORGLE procs inside the Profile DB to see how this is done.
Anyways, once I created the audiences with the proc. I used central admin to configure the rules.
In general, ...
1
Using Audiences would not give you the security that is otherwise enforced by the Permissions. Anyone knowing the item's address would be able still to access it.
Audiences are mostly used in scenarios such as content targeting, but does not change permissions access based on these rules, e.g. it only hides/shows web parts or records, depending on which ...
Only top voted, non community-wiki answers of a minimum length are eligible
