title: Change image from image folder on button click
body: <p>I would like to change image on button click. Basically I will let a user upload an image to the folder and when a button is clicked it will go to the next image in the folder when the previous button is click it will go back one image I have done something similar with switch statements, however I knew what images were in the folder making it easy to do that. My code for that is below:</p>
  
  <pre><code>  protected void Button2_Click(object sender, EventArgs e)
          {
              switch (Image1.ImageUrl)
              {
                  case "image1":
                      Image1.ImageUrl = "image2";
                      break;
                  case "image2":
                      Image1.ImageUrl = "image3";
                      break;:
                  default:
                      break;
              }
  }
  </code></pre>
  
  <p>This worked because I knew exactly what images were in the folder. The code I am trying to make Idk what images may be uploaded to the folder but would like to go through those as well with a button click.</p>