Creating Server Controls

In the previous sections you learned how to create user controls. User controls are a fast and easy way to create reusable user-interface elements in ASP.NET, and they serve as a more structured and richer alternative to server-side includes. However, user controls don't take full advantage of the .NET component model. As a result, they are somewhat limited in terms of functionality.

User controls are compiled automatically in the background, just as ASP.NET pages are. The first time your page is accessed in the browser, the page and any user controls on that page are compiled. After the first compilation, the page and user controls are recompiled only if you change their source code.

In contrast, server controls must ...

Get C#® Developer's Guide to ASP.NET, XML, and ADO.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.