images in wepages asp.net c#
Aim: To resize the images based on the resolution
Problem : If we do not resize, the alignment and image structuring will be gone
Need of the following code : I don't want to resize a small images to 100% width.      

        System.Drawing.Image img = System.Drawing.Image.FromFile(imgTest.Src);
        if (img.HorizontalResolution > 1000)
        {
            imgTest.Attributes.Add("width", "100%");
        }

Am I in the right way ? Or is there any other alternatives to do the same ?
images in wepages asp.net c#
===

Aim: To resize the images based on the resolution
Problem : If we do not resize, the alignment and image structuring will be gone
Need of the following code : I don't want to resize a small images to 100% width.      

        System.Drawing.Image img = System.Drawing.Image.FromFile(imgTest.Src);
        if (img.HorizontalResolution > 1000)
        {
            imgTest.Attributes.Add("width", "100%");
        }

Am I in the right way ? Or is there any other alternatives to do the same ?