|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
How to: Include ASP.NET User Controls in Web Pages
Adding an ASP.NET user control to a Web page is similar to adding other server controls to the page. However, you must be sure to follow the procedure below so that all of the necessary elements are added to the page.
For information about how to create a custom user control, see How to: Create ASP.NET User Controls.
To add an ASP.NET user control to a Web page
In Visual Web Developer, open the Web page to which you want to add the ASP.NET user control.
Switch to Design view.
Select your custom user control file in Solution Explorer, and drag it onto the page.
The ASP.NET user control is added to the page. In addition, the designer creates the @ Register directive, which is required for the page to recognize the user control. You can now work with the control's public properties and methods.