Working with HTML Server Controls

   

As you go through this section, you may begin to think, "These things look kinda familiar, Peter, and they ain't so innovative." But don't be deceived by their initial appearance; server controls are much more powerful than you think they are.

You see, HTML server controls are very much like the familiar HTML tags, with one difference: RUNAT="SERVER". That beautiful phrase, those lovely 14 characters change average HTML tags into SUPER TAGS with magical mystical powers. Well, not quite, but they do become…OBJECTS!! Yeah! Oh baby, oh baby. Objects are so cool, and HTML server controls are objects. What does that mean? They have all the advantages of being approachable from an event/object-oriented programming paradigm.

This means that you can manipulate the attributes, retrieve information, and affect with events standard HTML tags like you never could before. This group of objects has been assembled in the System.Web.UI.HtmlControls namespace (remember, a namespace is simply a location system). There are 22 objects in this namespace, but not all of them are for use on your ASP.NET pages. This brings up a topic that I'm going explain really briefly, but in reality we could spend much more time on it. That's the topic of inheritance.

We are not going to do an exhaustive study on inheritance here or anywhere in this book, for that matter, but I'm sure you understand the basics of inheritance from your everyday life experience.

I have green eyes and brown hair. These are traits, or, if you look at me as an object, properties that were given to me by my parents. I'm also left-handed, as are both my parents. I'm involved in computers just like my father. I have certain ways that I do things, or maybe you could call them methods of doing things, to better parallel an object. All these attributes, mannerisms, and traits are things that I inherited from my parents.

Objects have parents, too. The .NET Framework is full of inheritance that you just don't see. In the .NET Framework, all objects yup, all of them inherit methods from the System.Object class.

Some of the traits that I have gotten from my father probably came from my grandfather, or his grandfather. Inheritance as a concept travels across generations and generations. Each person through the years has also had personal traits that made him or her an individual, and with people inheritance is by chance. With .NET, inheritance is absolute. If an object is a parent of another object, the child object gets all the properties and methods of the parent.


   
Top


ASP. NET for Web Designers
ASP.NET for Web Designers
ISBN: 073571262X
EAN: 2147483647
Year: 2005
Pages: 94
Authors: Peter Ladka

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net