решил:
Код:
protected void forword_Click(object sender, ImageClickEventArgs e)
{
string directory = Server.MapPath(@"foto_all/");
DirectoryInfo dir = new DirectoryInfo(directory);
FileInfo[] imageFiles = dir.GetFiles("*.jpg");
++i;
if (i >= imageFiles.Length)
i = 0;
ImageMap1.ImageUrl = "foto_all/" + imageFiles.ElementAt(i);
}