JavaScript Editor jscript editor     Web designer 



Main Page

When working with templated controls such as the DataList control, you might not know until run time what templates you need or what text or controls the template should contain. In that case, you can create the templates dynamically in code.

NoteNote

You can also create templates as user controls and bind them dynamically to controls on your page. For details, see How to: Create Templated ASP.NET User Controls.

You can create templates in code for all controls that use templates: the DataList, Repeater, and GridView, FormView, and DetailsView controls. For the GridView control, you use templates to define columns instead of the row layout templates as for the other controls.

NoteNote

There are a few differences when creating template columns for the GridView control. For details, see Creating a Custom Column in a GridView Web Server Control.

Expand imageCreating the Template Class

Expand imageUsing the Dynamic Template

Expand imageAdding Data Binding to Templates

Expand imageSee Also



JavaScript Editor jscript editor     Web designer