Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

8.4. Controls

Just like behaviors, controls are visual components associated with DOM elements. Conceptually, a control differs from a behavior in the sense that instead of just providing client functionality, a control usually represents—or wraps—the element, to provide additional properties and methods that extend its programming interface. In ASP.NET, for example, a text box element is represented on the server side by the TextBox control. You can program against a TextBox object to specify how the element’s markup is rendered in the page. In the same manner, you can have a Text-Box control on the client side and program against it using JavaScript.

In the following sections, we’ll explore client controls and focus on a couple of scenarios where they’re useful. We’ll show you how to create an element wrapper and how to use a control to program against a block of structured markup code, instead of a single DOM element. In chapter 11, we’ll explain how you can use a control to program against a DOM element using the XML Script declarative language.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint