title: Variable does not exist in the current context
body: <p>I'm new to C# .NET. I would like to ask how this works... What I want is just to show an age selection from 1 to 100.</p>
  
  <p>Inside the <code>.aspx</code> file I put this code, I used data binding for the variable <code>listAge</code>.</p>
  
  <pre><code>&lt;asp:DropDownList ID="AgeDropDown" runat="server"&gt;
       &lt;%# listAge %&gt;
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>Here's the code-behind for it:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {            
      for (int i = 1; i &lt; 101; i++)
      {
          string listAge;
          listAge = "&lt;asp:ListItem&gt;"+ i +"&lt;/asp:ListItem&gt;";
      }
  }
  </code></pre>
  
  <p>The error shown inside the <code>.aspx</code> is:</p>
  
  <blockquote>
    <p><em>Error Creating Control: <code>AgeDropDown</code> - Code blocks are not supported in this context.</em></p>
  </blockquote>
  
  <p>Because of the variable <code>listAge</code>?</p>
  
  <p>Thank you for the help!</p>