Sharing an object between methods in same class (with postback)
<p>I have a user control with a number of methods. I also have a dataset object that I'm filling in one method, but I also need to access that same dataset (and the data in it) in another. </p>

<p>I am filling the dataset from some xml that I get from a webservice when someone clicks on a button. The data from the dataset is then bound to a listbox control. When someone selects an item in the list control (I have autopostback set to true on it) it then fires off another method and it's this method where I need to access the data in the dataset, but when I check the immediate window it's telling me that the dataset is set to null.</p>

<p>Where am I going wrong?</p>

<p><strong>Edited to add psuedocode</strong></p>

<pre><code>//Dataset 
DataSet dsAddress;

protected void Page_Load(object sender, EventArgs e)
{
    // Nothing happens to DataSet here
}
protected void btnPostCode_Click(object sender, EventArgs e)
{
    try
    {
        // Dataset has data added here
    }
    catch (Exception ex)
    {
        lblError.Text = ex.Message.ToString();
    }
    if (!DataHelper.DataSourceIsEmpty(dsAddress))
    {
       //Dataset bound to listbox here
    }

}  

protected void lstAddressDropdown_SelectedIndexChanged(object sender, EventArgs e)
{
    // Need to access dataset here       
}
</code></pre>
