What line of code should you use?

You have a publishing site. You plan to add an article page to a site by using a console application. You create a console application that contains the following code segment:

01: Using
02: Dim site As New SPSite(“http://internet”)
03: Dim web as SPWeb = site.RootWeb
04: Dim spSite as new PublishingSite(site)
05: Dim pWeb as PublishingWeb = PublishingWeb.GetPublishingWeb(web)
06: Dim articleCTID as New XPContentTypeID(08373…9373)
07: Dim articlePL as PageLayout=pWeb.GetAvailablePageLayout(articleCTID)(1)
08: Dim pageName as String = DateTime.Now.ToString(“yyyyMMdd-HHmmss”)
09: Dim nPage as PublishingPage =
pWeb.GetPublishingPages().Add(String.Format(“myPage.aspx”,”myPage”,0), articlePL)
10:
11: End Using

You need to ensure that the content owners can modify the page.

What line of code should you use?

You have a publishing site. You plan to add an article page to a site by using a console application. You create a console application that contains the following code segment:

01: Using
02: Dim site As New SPSite(“http://internet”)
03: Dim web as SPWeb = site.RootWeb
04: Dim spSite as new PublishingSite(site)
05: Dim pWeb as PublishingWeb = PublishingWeb.GetPublishingWeb(web)
06: Dim articleCTID as New XPContentTypeID(08373…9373)
07: Dim articlePL as PageLayout=pWeb.GetAvailablePageLayout(articleCTID)(1)
08: Dim pageName as String = DateTime.Now.ToString(“yyyyMMdd-HHmmss”)
09: Dim nPage as PublishingPage =
pWeb.GetPublishingPages().Add(String.Format(“myPage.aspx”,”myPage”,0), articlePL)
10:
11: End Using

You need to ensure that the content owners can modify the page.

What line of code should you use?

A.
nPage.Update()

B.
nPage.Schedule(String.Empty)

C.
nPage.CheckIn(String.Empty)

D.
nPage.QuickDeploy()



Leave a Reply 0

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