NET
You can apply multiple attributes to a particular class, method, or property. There are two
ways to do this. One syntax is to separate attributes by a comma within a set of brackets:
[DefaultProperty("Text"), toolboxdata("<{0}:mylabel runat=server>{0}:mylabel>")]
public class SuperLabel : Label
{...}
The other syntax is to put each attribute in its own set of brackets:
[DefaultProperty("Text")]
[ToolboxData("<{0}:mylabel runat=server>{0}:mylabel>")]
public class SuperLabel : Label
{...}
This completes our whirlwind tour of attributes and of the most common design-time
attributes available for use on custom controls. In this section we provided a short overview of
basic Designer attributes that we use in the code samples in this book. We cover design-time
support in more detail in Chapter 11.
Summary
The ASP.NET object model fully supports inheritance as a method of providing additional
functionality to existing controls. Given the object-oriented nature of the Framework, it is quite
easy to add powerful functionality with just a few lines of code.
ASP.NET provides two primary means of building controls: user controls and custom
controls. Encapsulation or composition is another method available in ASP.
Pages:
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156