Aaron Li's Blog

Write it down before I forget

  Home  |   Contact  |   Syndication    |   Login
  30 Posts | 0 Stories | 21 Comments | 1 Trackbacks

News

Google

Archives

Other's Idea

Data-Bound Controls (1) - Templates

 

In ASP.NET 2.0, the following controls are often used to do data binding.

1.      GridView

2.      DataList

3.      Repeater

4.      DetailsView

5.      FormView

 

GridView, DataList and Repeater are for displaying multiple records once, but DetailsView and FormView are for one record one time.

 

In addition, to decide which control to use, we’d better understand what templates every control supports and what is the built-in layout for every control.

 

Templates

 

Templates are usually for defining what content do display in certain area of the control.

 

GridView

  • EmptyDataTemplate
  • PagerTemplate

 DataList

  • HeaderTemplate
  • ItemTemplate
  • SeparatorTemplate
  • AlternatingItemTemplate
  • SelectedItemTemplate
  • EditItemTemplate
  • FooterTemplate

 Repeater

  • HeaderTemplate
  • ItemTemplate
  • SeparatorTemplate
  • AlternatingItemTemplate
  • FooterTemplate

 

DetailsView

  • HeaderTemplate
  • FooterTemplate
  • EmptyDataTemplate
  • PagerTemplate

 FormView

  • HeaderTemplate
  • ItemTemplate
  • SeparatorTemplate
  • AlternatingItemTemplate
  • SelectedItemTemplate
  • EditItemTemplate
  • InsertItemTemplate
  • FooterTemplate
  • EmptyDataTemplate
  • PagerTemplate

 

posted on Friday, March 30, 2007 9:34 PM

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: