Search the Community
Showing results for tags 'asp.net foreach count'.
Found 1 result
been searching for the answer for a long time i have this working code for a simple photo gallery for viewing photos when the images are too many it will take a long time to load all the imagebuttons i want to limit the imagebutton's to load only 10 photos, i will just put another next button for the next 10 photos and so on. this foreach loop portion is where it loads all the pictures inside the folder named "loveones" ImageButton imageButton = new ImageButton();FileInfo fileInfo = new FileInfo(strFileName);imageButton.ImageUrl = "~/pictures/loveones/" + fileInfo.Name;imageButton.Width = Unit.Pixel(200);imageButton.Height = Unit.Pixel(200);imageButton.Style.Add("padding", "5px");imageButton.Click += new ImageClickEventHandler(imageButton2_Click);Panel1.Controls.Add(imageButton); i wish some one could help me here in w3 school. thanks.