Ken Hassel

Ken Hassel

  • NA
  • 1
  • 14.5k

label, loop and images

Nov 25 2010 8:21 AM
Hello im trying to do a do while loop and by doing that i would like to populate a label.text with multiple div tags and strings.
I have a number in my database witch is 22, and means i have 22 images in one folder that i would like to create strings from ..
The other thing is that in each div tag i can ony have maximum 3 images, the first images gets the number 22(should be 1) while the two others gets 2 and 3(Witch is correct). I can only get 3 images to show and not all 22 in seperate divs

Code below:

 
 if (CurrentPage["AntallBilderFlash"] != null) // CurrentPage["AntallBilderFlash"] is the number 22
{ int b = Convert.ToInt32(CurrentPage["AntallBilderFlash"]); // int p = 1; int i = 1; int i1 = 2; int i2 = 3; string urler = "http://localhost/global/bilderflash/"; string name= "pic"; string slutt =".png"; do { Label1.Text = "<div><img src='" + urler + "" + name+ "" + i + "" + slutt + "'/><img src='" + urler + "" + name+ "" + i1 + "" + slutt + "'/><img src='" + urler + "" + name+ "" + i2 + "" + slutt + "'/></div>";
//i = i+3; //this.Controls.Add(Label1); i++; } while (i < b); }
thanks for helping me out if you can..
And yes my english is bad :)

Answers (1)