Improved ASP.NET Template Editing

Most Web server controls have a default look and layout that you can change by setting properties or by using styles. You can customize the look of some Web server controls by using templates. A template is a set of HTML elements and controls that make up the layout for a particular portion of a control. By working with templates, you can have complete control over the layout and appearance of the data within the control. The Web page designer in Visual Studio 2005 provides a simplified interface for creating and editing templates on complex controls, such as the DataList and GridView controls. The effects on the final appearance of the control can be seen while you edit the template.

When adding a control to a template in the designer, you can specify the databound expressions to associate with the control properties. For example, if you drag a TextBox control onto a template, you can bind the TextBox control's Text property to a particular field from the data control's data source. The Edit Databindings dialog box provided by the Visual Studio 2005 template editing designer enables you to easily bind particular fields by name.