Question:You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create the following controls:
  • A composite custom control named MyControl.
  • A templated custom control named OrderFormData.
You write the following code segment to override the method named CreateChildControls() in the MyControl class. (Line numbers are included for reference only.)

01 protected override void
02 CreateChildControls() {
03 Controls.Clear();
04 OrderFormData oFData = new OrderFormData("OrderForm");
06 }
You need to add the OrderFormData control to the MyControl control.

Which code segment should you insert at line 05?

 

A Controls.Add(oFData); 

B Template.InstantiateIn(this);
Template.InstantiateIn(oFData); 

C Controls.Add(oFData);
this.Controls.Add(oFData); 

D this.TemplateControl = (TemplateControl)Template;
oFData.TemplateControl = (TemplateControl)Template;
Controls.Add(oFData); 

+ Answer
+ Report
Total Preview: 2055

Copyright © 2024. Powered by Intellect Software Ltd