Geeks With Blogs

News
Google

Aaron Li's Blog Write it down before I forget

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 | Back to top


Comments on this post: Data-Bound Controls (1)

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Aaron Li | Powered by: GeeksWithBlogs.net