This documentation is archived and is not being maintained.

Getting Started — ASP.NET User Controls

Visual Studio 2005

In addition to using HTML and Web server controls, you can create custom, reusable controls using the same techniques you use for ASP.NET Web pages. These controls are called user controls.

While you need to choose a single language when authoring a user control, you can include multiple user controls—each authored in a different language—in a single ASP.NET Web page. For example, you can create one user control in Visual Basic that imports data from an XML file, and create another user control in C# that contains an order form, and include both controls in the same ASP.NET Web page.

You can cache output from a user control independently from the rest of its containing ASP.NET Web page. This technique, called fragment caching, can improve performance for your site. For example, if your user control contains an ASP.NET server control that makes a database request, but the rest of the page contains only literal text and simple code that runs on the server, you can use fragment caching in the user control to increase your application's performance.

The topics in this section provide essential information on working with user controls.

In This Section



Describes the events, methods, and properties of the .NET Framework class for user controls.

Related Sections

Walkthrough: Creating a Basic Web Page in Visual Web Developer

Describes how to create forms-based Web pages that are processed on the server.

ASP.NET User Controls

Introduces ASP.NET Web page user controls.

Caching Portions of an ASP.NET Page

Discusses the techniques you can use to cache regions of your pages using the @ OutputCache directive and user controls. This technique is useful if you do not want to cache entire pages.

See Also