I find uses for both models, but tend to try to use the markup in the aspx pages where I can because it is easier to read and helps me separate my view code from my logic code. The places where I programatically create controls and bind data to them are when I need a dynamic number of controls. A good example might be when you are generating a set of drop-downs dynamically for user search criteria -- I would do something like this:
SqlDataReader dr;
// Set up database connection and set dr to search query.
while(dr.Read())
{
Literal name = new Literal();
name.Text = dr["Name"] + ": ";
Page.Controls.Add(name);
DropDownList ddl = new DropDownList();
ddl.ID = "Search_" + dr["ID"];
SqlDataReader dr2;
// Set up database connection and set dr2 to search items query.
while(dr2.Read())
{
ListItem li = new ListItem(dr2["Name"], dr2["Value"]);
ddl.Item.Add(li);
}
Page.Controls.Add(ddl);
}
One other thing to keep in mind is you can create markup controls in your aspx page and then bind them to custom DataSets that you populate in your code-behind.