What should you do?

You have an audience for the Marketing Department. You plan to target all web parts on the default.aspx web page to the Marketing Department. You write the following code segment.

01: Using wpm as SPLimitedWebPartManager = objSite.GetLimitedWebPartManager (“default.aspx”, System.Web.UI.WebControls.WebPart.PersonalizationScope.[Shared])
02: Dim AM as New AudienceManager(ServerContext.Current)
03: For Each currentWP as WebPart in wpm.WebParts
04: currentWP.AuthorizationFilter = String.Format
(“~0~”,AM.GetAudiences(“Marketing”).AudienceID)
05:
06: Next
07:
08: End Using

You notice that all users still have access to the web parts on the default.aspx web page. You need to ensure that only users in the Marketing Audience can see the web part on default.aspx.

What should you do?

You have an audience for the Marketing Department. You plan to target all web parts on the default.aspx web page to the Marketing Department. You write the following code segment.

01: Using wpm as SPLimitedWebPartManager = objSite.GetLimitedWebPartManager (“default.aspx”, System.Web.UI.WebControls.WebPart.PersonalizationScope.[Shared])
02: Dim AM as New AudienceManager(ServerContext.Current)
03: For Each currentWP as WebPart in wpm.WebParts
04: currentWP.AuthorizationFilter = String.Format
(“~0~”,AM.GetAudiences(“Marketing”).AudienceID)
05:
06: Next
07:
08: End Using

You notice that all users still have access to the web parts on the default.aspx web page. You need to ensure that only users in the Marketing Audience can see the web part on default.aspx.

What should you do?

A.
Add the following code at line 5:
SPContext.Current.File.Update()

B.
Add the following code at line 5:
wpm.SaveChanges(currentWP)

C.
Add the following code at line 7:
AM.AudienceManager.Open(“Marketing”).Commit()

D.
Add the following code at line 7
SPContext.Current.Web.Update()

Explanation:
You plan to create a custom web part that displays a list of report definition files that the user can select. You need to pass the selected report definition file to a report viewer web part by using web part connection.

Which interface should you implement on a custom web part?

A. ICellConsumer
B. ICellProvider
C. IWebPartField
D. IWebPartRow



Leave a Reply 0

Your email address will not be published. Required fields are marked *