title: Maintain generic list between postbacks
body: <p>Here is what is in my code-behind:</p>
  
  <pre><code>List&lt;Event&gt; events = new List&lt;Event&gt;();
  
  protected void Page_Load(object sender, EventArgs e)
  {
  
  }
  
  protected void AddEvent_Click(object sender, EventArgs e)
  {
      Event ev = new Event();
  
      ev.Name = txtName.Text;
  
      events.Add(ev);
  }
  </code></pre>
  
  <p>I want to add an item to the list every time the Add button is clicked, but the list is reset after every postback. How can I keep the data in the list between postbacks?</p>