User controls & Composite web server controls
See the question and my original answer on StackOverflowThere is a comparison in the official documentation: Composite Control vs. User Control
I would go for a composite control if I plan to propose controls to other developers, like 3rd party controls vendors do. Then, I would add designer capabilities to these controls.
But, if I just want to develop controls that do custom things in a project, then user controls are easier to write, and require less ASP.NET inner knowledge.
Side note: Kothari's book is very good and a must read when developing composite controls, but it's not enough. Because it's an ASP.NET 1.1 book, there is no mention of very important notions that appeared in ASP.NET 2: the concepts of DataBoundControl
vs DataSourceControl
. All ASP.NET custom controls that appeared starting with .NET 2+, like FormView/GridView/DetailsView and ObjectDataSource, SqlDataSource, etc. are built on these fundamental concepts that are not covered in the book at all. Unfortunately, the book has never been updated, and I don't know of any other books that explain this with sufficient details.