Displaying multiple images with image control in asp.net 3.5
<p>I want to display all the images from given directory. For that i have given image controls to display images, but i want to display images control with that url automatically as per images in that directory. Suppose in my directory 5 images are present then 5 image controls should be display in my button click event.
I have written code in button_click event that displays only two images from the given directory is as follows :</p>

<pre><code>protected void btncompare_Click(object sender, EventArgs e)
{
    Bitmap searchImage;
    searchImage = new Bitmap(@"D:\kc\ImageCompare\Images\img579.jpg");
    string dir = "D:\\kc\\ImageCompare\\Images";

    DirectoryInfo dir1 = new DirectoryInfo(dir);
    FileInfo[] files = null;

    files = dir1.GetFiles("*.jpg");

    double sim;
    foreach (FileInfo f in files)
    {
        sim = Math.Round(GetDifferentPercentageSneller(searchImage, new Bitmap(f.FullName)), 3);
        if (sim &gt;= 0.95)
        {


            string imgPath = "Images/" + files[0];
            string imgPath1 = "Images/" + files[1];
            Image1.ImageUrl = "~/" + imgPath;
            Image2.ImageUrl = "~/" + imgPath1;
            Response.Write("Perfect match with Percentage" + " " + sim + " " + f);
            Response.Write("&lt;/br&gt;");

        }
        else
        {

            Response.Write("Not matched" + sim);
            Response.Write("&lt;/br&gt;");

        }

    }

}
</code></pre>
