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

  1. In Visual Web Developer, open the Web page to which you want to add the ASP.NET user control.

  2. Switch to Design view.

  3. 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.

See Also

Tasks

How to: Create ASP.NET User Controls

How to: Include a User Control in an ASP.NET Web Page

Concepts

ASP.NET User Controls Overview