 <p>You can <strong>not</strong> declare objects at runtime they way you art trying. You can store the week days in array / <a href="http://msdn.microsoft.com/en-us/library/6sh2ey19%28v=vs.110%29.aspx" rel="nofollow"><code>List&lt;T&gt;</code></a> starting Monday at index <code>0</code> and Sunday at index <code>6</code>, You can give id of element with the string name you want.</p> <pre><code>List&lt;TextBox&gt; weekList = new List&lt;TextBox&gt;(); weekList.Add(new TextBox()); weekList[0].ID = "txt" + ViewState["temp"].ToString(); </code></pre>