asp.net.ph

Skip Navigation LinksHome > Getting Started > ASP.NET Syntax > ASP.NET Page Syntax > Server Control Inline Template Syntax

Server Control Inline Template Syntax

ASP.NET Syntax   ASP.NET Page Syntax


Customizes the look and layout of ASP.NET server controls that support templates.

<templatename>
   Server control, databinding syntax, and so on
</templatename>

Markup Tags


templatename The name of the ASP.NET server control template.

Remarks

Templates allow you to customize the presentation of server controls on the pages in which they appear.

The following ASP.NET server controls support templates: the Repeater, DataList, DataGrid, GridView, FormView, and, to a limited extent, the DetailsView.

Template properties allow you to set how each template will render at runtime. You can include multiple template properties in a server control declaration.

Template syntax must be contained between the opening and closing tags of one of these server controls or between the opening and closing tags of a custom server control you have created.

Syntax Example

The below examples show how you can display data retrieved from a data source using templates on several of the ASP.NET controls that support them. The layout of the information is typically specified in an ItemTemplate, each actually representing an individual record from the data source.

DataList ItemCommand Event Example
Run Sample | View Source
FormView Example Details Page
Run Sample | View Source
GridView ImageField Example
Run Sample | View Source
See Also

Introducing ASP.NET Web Forms



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note