How to make Object visible throughtout the Page?
<p>I need a hand on this basic topic since I'm pretty new to webpages.</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            UserLogin ObjUser = new UserLogin();
            Persona ObjPersona = new Persona();
            DataSet ds = new DataSet();
            string UserName = null;
            UserName = WindowsIdentity.GetCurrent().Name;
            UserName = Regex.Replace(UserName, ".*\\\\(.*)", "$1", RegexOptions.None);                
            ds = ObjUser.GetUserData(UserName);
            ObjPersona.UserName = UserName;
            ObjPersona.RealName = ds.Tables[0].Rows[0][0].ToString();
            ObjPersona.Ranking = ds.Tables[0].Rows[0][1].ToString();
            if (((bool)ds.Tables[0].Rows[0]["TNT"] == false)) ObjPersona.TNT = false;
            else ObjPersona.TNT = true;
            if (((bool)ds.Tables[0].Rows[0]["TLG"] == false)) ObjPersona.TLG = false;
            else ObjPersona.TLG = true;
            if (((bool)ds.Tables[0].Rows[0]["NEG"] == false)) ObjPersona.Negocios = false;
            else ObjPersona.Negocios = true;
            if (((bool)ds.Tables[0].Rows[0]["RES"] == false)) ObjPersona.Residenciales = false;
            else ObjPersona.Residenciales = true;
            if (((bool)ds.Tables[0].Rows[0]["BO"] == false)) ObjPersona.BO = false;
            else ObjPersona.BO = true;
            if (((bool)ds.Tables[0].Rows[0]["BOA"] == false)) ObjPersona.BOA = false;
            else ObjPersona.BOA = true;
            ObjUser.CreateRegister(ObjPersona);
        }
    }
</code></pre>

<p>A simple execution once the page is loaded. A Stored procedure fills a DataSet and then I use the dataset to place the data into the Object, in this case <strong>ObjPersona</strong>.</p>

<p>Now, when I intend to use ObjPersona in another call, let's say.</p>

<pre><code>protected void BtnClose_Click(object sender, EventArgs e)
    {            
        ObjUser.UpdateRegister(ObjPersona);
        LblClose.Text = "Sesión Cerrada";
    }
</code></pre>

<p>It won't work since there's no data in there. (hits error once I want to use data from within the object)</p>

<p>I want to call the procedure for getting the user data just once (this case the page_load), and from there work with it. How can I access data recalled in another control?</p>

<p>Thanks.</p>
