O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

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 Control Adapters

Control templates are useful, but they are not supported by all controls, and they allow us to change only certain aspects of a control's appearance. An alternative approach is to use a control adapter.

Creating a Control Adapter

A control adapter is a mechanism designed to deal with differences between browsers, but we can co-opt it to gain wider influence over a control. To demonstrate creating and using a control adapter, we will use the RadioButtonList control. Listing 16-12 shows some markup that uses this control in a page.

Listing 16-12. Using the RadioButtonList control

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApp.Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ...

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