V
Varangian
ImageButton[] ship;
ship = new ImageButton[5];
for (int i=0; i<5; i++)
{
ship.ImageUrl = pathofImage;
ship.ID = "ShipNo" + i.ToString();
ship.Click += new ImageClickEventHandler(this.ImageBtn_Click);
this.Form1.Controls.Add(ship);
}
I have this peace of code on the start page... and is giving me an
error "Object reference not set to an instance of an object"... I
cannot see what I'm doing wrong. the Array seems good
Any Help?
Thanks
ship = new ImageButton[5];
for (int i=0; i<5; i++)
{
ship.ImageUrl = pathofImage;
ship.ID = "ShipNo" + i.ToString();
ship.Click += new ImageClickEventHandler(this.ImageBtn_Click);
this.Form1.Controls.Add(ship);
}
I have this peace of code on the start page... and is giving me an
error "Object reference not set to an instance of an object"... I
cannot see what I'm doing wrong. the Array seems good
Any Help?
Thanks