I have a problem creating an array of ImageButtons and to show them on screen. This is what I did:

ImageButton[] aImageButton = new ImageButton[9];
Panel1.Visible = true;
for (int i = 0; i <= 9; i++)
{
    aImageButton[i] = new ImageButton();
    aImageButton[i].ID = "ImageButton" + (i + 1);
    aImageButton[i].Width = 100;
    aImageButton[i].Height = 100;
    aImageButton[i].BorderWidth = 0;
    aImageButton[i].ImageUrl = "http://uxrepo.com/static/icon-sets/font-awesome/svg/circle-empty.svg";
    aImageButton[i].Visible = true;
    Panel1.Controls.Add(aImageButton[i]);
    Panel1.Controls.Add(new LiteralControl());
}

So, basically I have created a panel, where I want to show my ImageButtons. created an array called aImageButton and then using a for loop I want to create the buttons, but they not showing on the page.

I would like to get some help, what am I doing wrong?

Related posts

Recent Viewed