PrepAway - Latest Free Exam Questions & Answers

Which code segment should you add at line 09?

You have a SharePoint site collection that has the URL http://contoso/sites/finance. You are
creating a Microsoft .NET Framework console application that will use the SharePoint client object

model to create a site in the site collection. The application contains the following code segment.
(Line numbers are included for reference only.) 01 ClientContext cCtx = new
ClientContext(“http://contoso/sites/finance”); 02 Web root = cCtx.Site.RootWeb; 03
cCtx.Load(root); 04 WebCreationInformation webInfo = new WebCreationInformation(); 05
webInfo.Title = “site1”; 06 webInfo.Url = “site1”; 07 webInfo.WebTemplate = “MPS#2”; 08
root.Webs.Add(webInfo); 09 10 cCtx.Dispose(); You need to ensure that the application creates
the site. Which code segment should you add at line 09?

PrepAway - Latest Free Exam Questions & Answers

A.
coot.Update ();

B.
root.Context.Dispose ();

C.
cCtx.Site.RootWeb.Update ();

D.
cCtx.ExecuteQuery ();


Leave a Reply