Custom Controls Versus User Controls

In Chapter 9, you learned how to build your own user controls to encapsulate frequently used pieces of your ASP.NET pages. Custom controls serve a purpose that is very similar to user controls, and in fact often you will find that the same task could be accomplished using either a user control or a custom control. User controls are designed to be used for large sections of your ASP.NET pages, and in fact they were originally going to be named Pagelets. User controls are typically easier to build and deploy than custom controls, because you can place all your HTML logic and other controls into the .ascx file, and you can deploy the user control without having to compile it first. Custom controls, on the other ...

Get ASP.NET by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.