What Is a Template?

only for RuBoard

Essentially, a template is a repeating or non-repeating set of HTML elements or .NET controls mixed with data that make up part of the layout of a web form or user control. Whereas styles affect the appearance of elements, templates create a pattern of elements that makes up a layout. Of course, you can use styles with templates (as we will demonstrate ) to affect the look of the elements that are rendered when you're using templates.

As stated, there are currently three intrinsic .NET server controls support templates: DataGrid , DataList , and Repeater .

Beyond using the intrinsic .NET server controls, you can develop your own server controls to support templates. In our next book, Developing Server Controls for ASP.NET , we will go into greater detail on how to create custom .NET server and user controls and we will discuss how to develop controls that support templates. In this chapter, however, we will only be going over intrinsic server controls and their inherent support of templates.

Each of the server controls supports a similar set of templates ”although as you'll see a template might behave differently from control to control. The following sections will examine each of the three server controls and the templates they support. Each section will contain one or more code examples illustrating how to implement templates using that particular control.

only for RuBoard


Programming Data-Driven Web Applications with ASP. NET
Programming Data-Driven Web Applications with ASP.NET
ISBN: 0672321068
EAN: 2147483647
Year: 2000
Pages: 170

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