title: Prevent loading data until event
body: <p>I have a bunch of GridView on one page, and each have their own coordinating SqlDataSource.</p>
  
  <p>They all load their coordinating data when initializing the page (on the page load). I want to Load the data for specific SqlDataSource(s) on the page when the user clicks a button, so that it is not trying to load ALL the data for all the different grids all at the same time when the page initially loads.</p>
  
  <p>Note: I need to also have Paging working, and anything I have tried so far has broken the paging functionality.  </p>
  
  <p>Looking to tell the SqlDataSource what data to bind to it after the user clicks a button, and then have the specific GridView Bind that data to it and have the Paging functionality work with the data it was told to load.</p>
  
  <p>Environment: C#, WebForms, ASP.NET, .NET 3.5, Controls SqlDataSource / GridView</p>
  
  <p>From what I can tell it correctly binds the data, but the 'gridview' control keeps disappearing when I click one of the pages at the bottom for the paging.</p>
  
  <p>Note: If I click the button again, it will show the correct page and the correct data for the page.</p>
  
  <pre><code>protected void btn_LoadData2_Click(object sender, EventArgs e) { Gridview2.DataSourceID = "DataSource2"; Gridview2.SelectCommand = "SELECT * FROM dbo.DataNeeded"; Gridview2.DataBind(); Gridview2.DataBind(); }
  </code></pre>