Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: C#  |  size: 0.74 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7.  
  8. namespace WebForms
  9. {
  10.     public partial class WebForm1 : System.Web.UI.Page
  11.     {
  12.         protected void Page_Load(object sender, EventArgs e)
  13.         {
  14.            
  15.         }
  16.  
  17.         public class Test
  18.         {
  19.             public int ID { get; set; }
  20.         }
  21.  
  22.  
  23.         protected void LinqDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
  24.         {
  25.             var tests = new List<Test>();
  26.  
  27.             for (int i = 0; i < 100; i++)
  28.             {
  29.                 tests.Add(new Test(){ID = i});
  30.             }
  31.  
  32.             e.Result = tests;
  33.         }
  34.     }
  35. }