title: Access other asp:Controls from asp:ObjectDataSource-SelectMethod
body: <p>I have a simple webcontrol.ascx with an listview and 2 Integer fields (show nbr. of certain elements). The Listview gets filled from an asp:ObjectDataSource.</p>
  
  <p>My Problem is that both the listview and my 2 integer values need access to the same database table and I really dont want to make that call twice (Inside the Page_Load for the 2 fields and inside the SelectMethod for the ObjectDataSource)</p>
  
  <p>The Problem is that I dont see a simple way for the two methods (Page_Load and SelectMethod) to exchange any data (with local properties for example).</p>
  
  <pre><code>private mydata As List(of ...)
  
  protected Sub Page_Load(...) Handles Me.Load
      mydata = DbManager.HeavyCall(...)
      literalValueA.Text = (From i in mydata ..... ).Count
      literalValueB.Text = (From i in mydata ..Where ... ).Count
  End Sub
  
  ' SelectMethod for asp:ObjectDataSource
  public Function GetData( ... ) As List(of ...)
  
      mydata.DoSomething(...)  ' mydata is Nothing here...
  
  end Function
  </code></pre>
  
  <p>I hope someone can tell me a good solution (preferable without external cache..) of how to exchange data between the two methods..</p>