Sharing variables and putting text box data into an array
<p>I'm brand new to the subject and very lost. I have a text box on my webSite.  The <em>data entered into the textBox</em> will be <em>placed in an array</em>, and a <em>counter will increase</em>. Once the <em>counter reaches five</em>, you <em>cannot add more</em> to the array.</p>

<p>There will be a button to display all the names input into the array, which clears the array and the counter as well.</p>

<p>I have no idea how to order classes and methods in C#. I put the buttons inside of the main class so that I can share variables between them, but then I can't access the text box.</p>

<p>Some code is there because I'm trying to figure this out, but it may not belong in here.  The code is also rather bare because I'm just trying to figure it all out. Any help is appreciated.</p>

<pre><code>&lt;script runat="server"&gt; 

public partial class Arrays
{
  private int Counter = 0;    

  protected void btnEnter_Click(object sender, EventArgs e)
  {
    Button btn = (Button)sender;
    btn.Text = (Int32.Parse(btn.Text) + 1).ToString();
    Label1.Text = "Enter Another student's name";
  }

  public void btnEnter_Click2(object sender, EventArgs e)
  {
     Label1.Text = "Enter a student's name ";        
  }
}

&lt;/script&gt;
</code></pre>
