Partilhar via


AudienceManager.CheckRuntimeRender Method

Checks whether the audience membership of the current user is contained in the audience list of any Web Parts in this Web site based on Microsoft Windows SharePoint Services.

Namespace:  Microsoft.Office.Server.Audience
Assembly:  Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)

Syntax

'Declaration
Public Function CheckRuntimeRender ( _
    isIncludedFilter As String _
) As Boolean
'Usage
Dim instance As AudienceManager
Dim isIncludedFilter As String
Dim returnValue As Boolean

returnValue = instance.CheckRuntimeRender(isIncludedFilter)
public bool CheckRuntimeRender(
    string isIncludedFilter
)

Parameters

  • isIncludedFilter
    Type: System.String

    List of audience globally unique identifiers (GUIDs) in comma-delimited format. Each GUID must be contained in single quotation marks.

Return Value

Type: System.Boolean
A Boolean value. true if the audience list contained in the isIncludedFilter parameter is persisted by a Web Part in this SharePoint site; otherwise, false.

Implements

IRuntimeFilter.CheckRuntimeRender(String)

Remarks

The CheckRuntimeRender method implements the CheckRuntimeRender method from the IRuntimeFilter interface in the Microsoft.SharePoint.WebPartPages namespace. This method always returns a value of true if the AudienceManager object was initialized without a reference to a SPServiceContext object. This allows a Web Part with an associated audience GUID list to be imported into a site that is not based on Microsoft SharePoint Server 2010 without throwing exceptions.

Examples

The following code example shows how to construct the list of audience GUIDs and invoke the CheckRuntimeRender method.

String AudienceList;
AudienceManager AudMgr = new AudienceManager();
bool ret;

AudienceList = "'00000000-0000-0000-0000-000000000000', '00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0000-000000000002'";
ret = AudMgr.CheckRuntimeRender(AudienceList);
Dim AudienceList As String
Dim AudMgr As New AudienceManager()
Dim ret As Boolean

AudienceList = "'00000000-0000-0000-0000-000000000000', '00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0000-000000000002'"
ret = AudMgr.CheckRuntimeRender(AudienceList)

See Also

Reference

AudienceManager Class

AudienceManager Members

Microsoft.Office.Server.Audience Namespace