nerdexam
Microsoft

70-573 · Question #126

You create a Web Part that contains the following code segment. (Line numbers are included for reference only.) 01 Public Class WebPart1 02 Inherits WebPart 03 04 Public Sub New() 05 MyBase.New 06…

The correct answer is C. Add the following line of code at line 11. See the full explanation below for the reasoning.

Question

You create a Web Part that contains the following code segment. (Line numbers are included for reference only.) 01 Public Class WebPart1 02 Inherits WebPart 03 04 Public Sub New() 05 MyBase.New 06 07 End Sub 08 09 Protected Overrides Sub CreateChildControls() 10 Dim clickButton As Button = New Button 11 12 MyBase.CreateChildControls 13 End Sub 14 15 Protected Overrides Sub RenderContents (ByVal writer As HtmlTextWriter) 16 17 MyBase.RenderContents(writer) 18 End Sub 19 End Class You discover that the clickButton button does not appear. You need to ensure that clickButton appears. What should you do?

Options

  • ADelete line 12.
  • BMove line 10 to line 16.
  • CAdd the following line of code at line 11.
  • DAdd the following line of code at line 11.

How the community answered

(60 responses)
  • A
    12% (7)
  • B
    5% (3)
  • C
    80% (48)
  • D
    3% (2)

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice