my datasource is a list of customers in a webforms project
protected void Page_Load(object sender, EventArgs e)
{
List<Customer> customers = new List<Customer>();
customers.Add(new Customer() { FirstName = "John", PhoneNumber = "999.999.9999" });
customers.Add(new Customer() { FirstName = "Jane", PhoneNumber = "999.999.9999" });
}
is there a way to iterate that in an aspx page of a web forms project. (this is easy in mvc using the model)?
Use the Repeater control for this. Here is an example:
Markup:
Code behind: