title: How to use one datasource for many repeaters
body: <p>first of all let me say I am a novice when it comes to .NET development.</p>
  
  <p>I am working with an order confirmation page and lots of different services want to know essentially the same information; Order Number, Number of Items, Total Value etc...</p>
  
  <p>They also want me to call javascript functions or include html tags for each product ordered. </p>
  
  <p>I am currently doing this using asp:Repeaters which works fine. However they all use the same DataSource. What is frustrating is that I can't just do:</p>
  
  <pre><code>// in codebehind
  rep_items.DataSource = CustomerOrder.Items
  rep_items.DataBind()
  </code></pre>
  
  <p>and then use rep_items on all my different repeaters:</p>
  
  <pre><code>// .aspx page
  &lt;!-- Google Analytics --&gt;
  &lt;asp:Repeater ID="rep_items" runat="server"&gt;
      &lt;ItemTemplate&gt;
          _gaq.push("&lt;%=productID%&gt;");
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  
  &lt;!-- Another Service --&gt;
  &lt;asp:Repeater ID="rep_items" runat="server"&gt;
      &lt;ItemTemplate&gt;
          anotherService.trackOrder("&lt;%=productID%&gt;");
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>What I have to do is this:</p>
  
  <pre><code>// Code behind
  
  rep_googleAnalytics.DataSource = CustomerOrder.Items
  rep_googleAnalytics.DataBind()
  rep_AnotherService.DataSource = CustomerOrder.Items // Same datasource as above
  rep_AnotherService.DataBind()
  // As more services are added this gets longer
  
  // .aspx page
  &lt;!-- Google Analytics --&gt;
  &lt;asp:Repeater ID="rep_googleAnalytics" runat="server"&gt;
      &lt;ItemTemplate&gt;
          _gaq.push("&lt;%=productID%&gt;");
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  
  &lt;!-- Another Service --&gt;
  &lt;asp:Repeater ID="rep_anotherService" runat="server"&gt;
      &lt;ItemTemplate&gt;
          anotherService.trackOrder("&lt;%=productID%&gt;");
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>As you can see I have to bind the same datasource to different objects. Can I use the same datasource but a different  for each service that needs the same data?</p>