You need to use a container that will contain your child controls (like button, literal, etc.), , so it needs to implement the WebControl class.
A literal is not inferred from the system.Web.UI.WebControls namespace. Therefore, there cannot be a collection of controls.
Basically, you need to use the server control as a base class that defines methods, properties, and events that are common to all controls in the System.Web.UI.WebControls namespace.
How to complete your task?
Read the following MSDN article - How to Add Controls to ASP.NET Software Web Page
source share