Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
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.

How to: Include ASP.NET User Controls in Web Pages (Visual Studio)

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 (Visual Studio).

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

Community Additions

© 2015 Microsoft