for (int i = 1; i < 10; i++) { Image imag = new Image(); imag.ImageUrl = string.Format("images/img{0}.jpg", i); this.divImage.Controls.Add(imag); }