Data Binding ASP.Net Tutorial

<%@ Page Language="C#" Debug="true" %>



    Simple page with declarative data binding


    
        
                                  DataSourceID="_itemsDataSource">
            Sample item 1
            Sample item 2 ...
        
        
        Total number of items = xx
        
                     TypeName="Architecture.MyDataSource"
             SelectMethod="GetItems" />
    


File: MyDataSource.cs
using System;
namespace Architecture
{
  public static class MyDataSource
  {
    static string[] _items = 
      {"Item #1", "Item #2", "Item #3", "Item #4", 
       "Item #5", "Item #6", "Item #7", "Item #8", 
       "Item #9", "Item #10"};
    public static string[] GetItems()
    {
      return _items;
    }
  }
}