Business object persistence on postback
<p>Say I have a page in my web application that lets a user update their contact information. Pretend in order to retrieve or save this information I have the following class:</p>

<pre><code>public class User
{
    DataAccesClass dataAccesClass = new DataAccesClass()
    public string UserName {get;set;}
    public string Address {get;set;}
    public string EmailAddress {get;set;}

    public User(){}

    public static User GetUser(int userID)
    {
         User user = dataAccesClass.GetUser(userID); //
         return user;
    }

    public void Save()
    {
        dataAccesClass.SaveUser(this);
    }
}
</code></pre>

<p>Say that on my Page_Load event I create a new instance of my User class (wrapped in a !isPostBack). I then use it's public properties to populate text fields on said page in my web application. Now the question is... When the page is posted back, what is the correct way to rebuild this class to then save the updated information? Because the class was created on Page_Load !isPostBack event it is not available. What is the correct way to handle this? Should I store it in a Session? ViewState? Should I simply rebuild it every post back? The User class in this example is small so that might influence the correct way to do it but I'd like to be able to take the same approach for much larger and more complex classes. Also, would this class be considered an acceptable business object?</p>
