title: How do I rotate an Image in .NET?
body: <p>I have an asp.net 2010 project. I write a jpg to the filesystem. Then I display it in an Image control. Then I use this code on button click to allow the user to rotate it 90 degrees. </p>
  
  <pre><code>string path = Server.MapPath(Image1.ImageUrl) ;
  
  // creating image from the image url
  System.Drawing.Image i = System.Drawing.Image.FromFile(path);
  
  // rotate Image 90' Degree
  i.RotateFlip(RotateFlipType.Rotate90FlipXY);
  
  // save it to its actual path
  i.Save(path);
  
  // release Image File
  i.Dispose();
  </code></pre>
  
  <p>It does rotate (I can actually watch that happen in Windows Explorer). But when I run the app again and it grabs the file from its path, it still displays it in its original form.</p>