I am trying to replace random number with pictures. for example If random number is 1 show picture black.jpg:
Cache[diceKey] = r.Next(1, 5); // random (1-4)
if (r.Next(1, 2) == 1 )
image.BackImageUrl = "Images/black.png";
is there any solutions that I can show my picture if random number is 1?
As I already said in my comment
r.Next(1, 2)will always return 1, so you will always show that black image…I think you should change your code to this: