PrepAway - Latest Free Exam Questions & Answers

Which code segment should you add at line 6?

You need to programmatically target a list item to an Audience. You write the following code segment:

01: Dim siteAudience as Audience
02: Dim context as ServerContext = ServerContext.GetContext(site)
03: Dim audManager as New AudienceManager(context)
04: siteAudience = audManager.GetAudience(“audience1”)
05: Dim id as GUID = siteAudience.AudienceID
06:
07: Item.Update()

Which code segment should you add at line 6?

PrepAway - Latest Free Exam Questions & Answers

A.
Item (“target Audiences”) = id.toString() & “;;;;”

B.
Item (“target Audiences”) = id.toString() & “;;;;”

C.
Item.Fields.AddFieldsAsXML = (“<targetAudiences>” & id.toString() & “;;;;</targetAudiences>”)

D.
Item.roleAssignments.Add(New SPRoleAssignment(id.toString() & “;;;;”, String.Empty, String.Empty, String.Empty)


Leave a Reply