O'Reilly logo

Special Edition Using® Microsoft® ASP.NET by Richard Leinecker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Controls from the Toolbox

There are two ways to use custom controls that you’ve written. One is to add a Reference to the Solution Explorer, and the other is to add custom controls to the Toolbox.

Add a Control Reference

I’ll use a custom control first by adding a Reference in the Solution Explorer, as shown in Figure 13.1. Start by right-clicking on the References item in the Solution Explorer and choosing Add Reference. Then, I’ll add the appropriate using/import statement (depending on whether you are using C# or VB) to the source code and declare and use the controls as shown in Listing 13.2.

Figure 13.1. You can add a Reference to the Solution Explorer to enable you to easily use a custom class.

Listing 13.2 shows code that is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required