ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
FAQ
Login
 
ASP Dot Net Tutorial - Index
ASP Dot Net Tutorial - Microsofts ASP.NET
ASP Dot Net Tutorial - Begining Web Forms
ASP Dot Net Tutorial - User Controls
ASP Dot Net Tutorial - ADO .NET
ASP Dot Net Tutorial - DataBinding to WebControls
ASP Dot Net Tutorial - DataList Controls
ASP Dot Net Tutorial - DataGrid Control
ASP Dot Net Tutorial - Advance Practical Examples on DataGrid
ASP Dot Net Tutorial - Working with DataSets
ASP Dot Net Tutorial - Working with XML
ASP Dot Net Tutorial - Forms Based Authentication
ASP Dot Net Tutorial - Windows Based Authentication
     

 
Online Personal Trainer Certification
Personal Trainer Certification (Spanish)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Makeup Artist Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant Certification
  All Online Courses
   

   
   
   
   
   
   

   
  Home > Courses, Tutorials & eBooks > ASP.NET Tutorial > The DataList Controls
 

ASP.NET Tutorial - The DataList Controls

                                                                                                                Page 3 of 3
 

Using Templates with a DataList

Templates can be used with a DataList, to control the formatting of displayed items.

For example, suppose you want to display multiple database fields for each item displayed by the DataList. You can format the appearance of each DataList item by placing an HTML table in the ItemTemplate.

The output of the above example is shown below:

In the above example three templates are used:- an ItemTemplate, aHeaderTemplate and a SeparatorTemplate.

  • HeaderTemplate displays the heading Employee Home phone numbers at the top of DataList.
  • The ItemTemplate displays each author’s first name, last name and home phone number.
  • The SeperatorTemplate renders a horizontal rule beween each item(just like <HR> tag of HTML)

Binding Data to the Control

As discussed earlier that to bind data to control, the DataList control must be bound to a data source. Typical data sources for the DataList are data sets or Data View and data readers (OleDbDataReaderor SqlDataReader objects). Binding can also be done to data sources created in code, such as a data reader or an array. The control can be used as a data source and any class that supports the IEnumerable interface.

When a data is bounded, a data source is specified for the DataList control as a whole. When other controls are added to the control — for example, labels or text boxes in list items — they are in turn bounded to the container, namely the DataList control.

       

 

 

 
     
Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
 
© ExpertRating 2015. All Rights Reserved.