123
?– ?– ?–
C H A P T E R 4
The WebControl Base Class
and Control Styles
The ability to configure how a web page renders its HTML elements is an essential requirement
of any web development model. As you would expect, the .NET Framework and ASP.NET
3.5 provide a rich architecture to support styling of web page elements through server controls
on the web form.
In this chapter, we introduce a new server control construction model and build several
custom server controls that inherit from WebControl (instead of Control) as a means to examine
how to customize control styling using the System.Web.UI.WebControls.Style class, as well as
a means to introduce the more powerful rendering model provided by the WebControl class.
In the final portion of the chapter, we discuss how to customize ViewState storage to
preserve any applied styling and we show how to override the Style property to support your
own customized style class for further customization of appearance. This section also highlights
the benefits the strongly typed styling mechanism provided by ASP.NET.
Customizing the Appearance of Controls
Controls have a tough crowd to please. Programmers want them to be powerful, easy to use,
robust, high performing, and fully customizable in their look and feel.
Pages:
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211