title: Is it possible to get a SqlDataSource parameter from the ViewState in asp.net web forms?
body: <p>I have a SqlDataSource defined in my aspx file that I use to call a StoredProcedure. It takes a hiddenField as its control parameter.</p>
  
  <pre><code>&lt;asp:HiddenField ID="input" runat="server" /&gt;
  
  &lt;asp:SqlDataSource ID="source" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:ConnectionString %&gt;" 
      SelectCommand="sp" SelectCommandType="StoredProcedure"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:ControlParameter ControlID="input" Name="input" Type="String" /&gt;
      &lt;/SelectParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>Is there a way I can grab that parameter from the ViewState instead? Preferably while keeping the datasource definition in the aspx file.</p>