70-573 · Question #213
You have a SharePoint site collection that contains 100 subsites. You plan to create a Web Part. The Web Part will be deployed to each subsite. You need to ensure that the Web Part retrieves all of…
The correct answer is C. web.Files. MNEMONIC RULE: "current subsite = web = web.Files" Gets the collection of all files in the root directory of the website. SPWeb.Files Property
Question
You have a SharePoint site collection that contains 100 subsites. You plan to create a Web Part. The Web Part will be deployed to each subsite. You need to ensure that the Web Part retrieves all of the files in the root directory of the current subsite. You write the following code segment. (Line numbers are included for reference only.) 01Dim site As SPSite = SPContext.Current.Site 02Dim web As SPWeb = SPContext.Current.Web 03 Which code segment should you add at line 03?
Options
- Asite.AllWebs[1].Files
- BSite.RootWeb.Lists[0].Items
- Cweb.Files
- Dweb.RootFolder.SubFolders[0].Files web.Users.Add(currentUser.
How the community answered
(51 responses)- A4% (2)
- B16% (8)
- C75% (38)
- D6% (3)
Explanation
MNEMONIC RULE: "current subsite = web = web.Files" Gets the collection of all files in the root directory of the website. SPWeb.Files Property
Topics
Community Discussion
No community discussion yet for this question.