Writing Custom Controls

The Atlas Control Toolkit grows from release to release, but it also offers a framework for creating custom controls. If you find yourself using the same JavaScript effects over and over, making them available for reuse via Atlas is a good idea.

In this section, you’ll create an extender that restricts input into an HTML text box to a set of predefined characters—functionality that HTML does not offer. The Atlas Control Toolkit provides a project template for Visual Web Developer that facilitates this work. You start by installing the template, and then you change it and add the logic for the new extender.

As you’ve probably noticed, the Atlas Control Toolkit comes as one DLL file that contains all of the controls. You will likewise need to compile code to create a custom control. Fortunately, the toolkit ships with a Visual Studio template that makes creating such extenders easy.

In the AtlasControlExtender folder created by the Atlas Control Toolkit installer, you will find a VSI file (AtlasControlExtender.vsi) that installs a package you can use to implement custom extenders. To install the package, just double-click the VSI file. The package contains project templates for both C# and Visual Basic (see Figure 14-7).

The Atlas control extender VSI installer

Figure 14-7. The Atlas control extender VSI installer

Tip

If you are using Visual Web Developer Express Edition, ...

Get Programming Atlas now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.