What should you do to derive the ProductsGrid class from the appropriate base class or interface?

You are developing a custom control named ProductsGrid that will be used in the redevelopment of Domain.com’s e-Commerce Web applications. The ProductsGrid control contains a TextBox control and a DropDownList control that allows for the editing of product descriptions. You need to derive the ProductsGrid class from the appropriate base class or interface.
What should you do?
(Each correct answer represents part of the solution. Choose two.)

You are developing a custom control named ProductsGrid that will be used in the redevelopment of Domain.com’s e-Commerce Web applications. The ProductsGrid control contains a TextBox control and a DropDownList control that allows for the editing of product descriptions. You need to derive the ProductsGrid class from the appropriate base class or interface.
What should you do?
(Each correct answer represents part of the solution. Choose two.)

A.
Use the CompositeControl base class.

B.
Use the Control base class.

C.
Use the WebControl base class.

D.
Use the INamingContainer interface.

Explanation:

You must derive the control from the Control class before it can be rendered on the page. You can derive the class from the CompositeControl base class, which is the base class that derives from WebControl and implements INamingContainer. The INamingContainer interface generates unique identifiers for the control’s child controls.

Incorrect Answers:
C: If you derive the class from WebControl, you must also implement the INamingContainer interface, which generates unique identifiers for the control’s child controls. You must also derive the control from the Control class before it can be rendered on the page but you can only choose two options!
D: The INamingContainer interface unique identifiers for the control’s child controls and is used in conjunction with a base class such as WebControl. You must also derive the control from the Control class before it can be rendered on the page but you can only choose two options!



Leave a Reply 0

Your email address will not be published. Required fields are marked *