nerdexam
Microsoft

70-573 · Question #189

You are creating a Web Part for SharePoint Server 2010. The Web Part contains the following code segment. (Line numbers are included for reference only.) 01 Protected Overloads Overrides Sub…

The correct answer is B. 03. See the full explanation below for the reasoning.

Question

You are creating a Web Part for SharePoint Server 2010. The Web Part contains the following code segment. (Line numbers are included for reference only.) 01 Protected Overloads Overrides Sub CreateChildControls() 02 MyBase.CreateChildControls() 03 SPSecurity.RunWithElevatedPrivileges(ElevatedCode) 04 05 End Sub 06 Private Sub ElevatedCode() 07 Dim ListCount As New Label() 08 ListCount.Text = [String].Format ("There are {0} Lists", SPContext.Current.Web.Lists.Count) 09 Controls.Add(ListCount) 10 End Sub You need to identify which line of code prevents the Web Part from being deployed as a sandboxed solution. Which line of code should you identify?

Options

  • A02
  • B03
  • C08
  • D09

How the community answered

(49 responses)
  • A
    6% (3)
  • B
    80% (39)
  • C
    2% (1)
  • D
    12% (6)

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice