If you want to add the divs from Code behind then first of all you need to add runat attribute in the main div tag like this:
<div id="maindiv " runat="server">
....
....
</div>
Then after this you can add as many divs as you like from the code behind. E.g.:
string childdiv = string.Empty;
for(int i=0; i< 5; i++)
{
childdiv += "<div id=\"div" + i.ToString() + "\"></div>";
}
maindiv.innerHTML = childdiv ;