title: Access placeholders in a loop
body: <p>I need to create the names of my placeholders dynamically in a loop in C# but I don't know how i can get the right name.</p>
  
  <p>The placeholders are set in the aspx page and with <code>currMaxValues</code> is the max. number of Placeholders set.</p>
  
  <p>My current markup: </p>
  
  <pre><code>const int currMaxValues = 6;
  
          for (int i = 0; i &lt; currMaxValues; i ++)
          {
              //new placeholdernames
              string currPlaceholderTime = "placeholderTime" + i;
              string currPlaceholderMore = "placeholderZusatz" + i;
              string currPlaceholderIco = "placeholderIco" + i;
              string currPlaceholderTemp = "placeholderTemp" + i;
  
              //elements for placeholders
              Label time = null;
              Label more = null;
              Image img = null;
              Label temp = null;
  
              //built the stuff for the placeholders
              DateTime currTime = DateTime.Now;
              int hour = currTime.Hour;
              time.Text = hour.ToString();
  
              //(PlaceHolder)currPlaceholderTime.Controls.add(time);
          }
  </code></pre>
  
  <p>Is it possible to use the name of the Placholder that I created at the beginning of the loop to access the controls?</p>
  
  <p>Thanks for any help!</p>