Image Resize Issue in asp.net
<p>i have an img tag </p>

<pre><code>&lt;asp:Image ID="imgCatalog" ImageAlign="middle"    Height='&lt;%#GetImageWidth(Eval("PictureName")) %&gt;' ImageUrl='&lt;%#GetImageUrl(Eval("PictureName")) %&gt;'   runat="server"/&gt;
</code></pre>

<p>i want to resize every image during loading the page and i used GetImageWidth function.</p>

<pre><code>public Unit GetImageWidth(object ImageName)
{
    string strimagename = Convert.ToString(ImageName);
    //string strimagewidth = "";
    int width = 0;
    if (System.IO.File.Exists(Server.MapPath(GetImageUrl(strimagename))))
    {
        System.Drawing.Image img = System.Drawing.Image.FromFile(Server.MapPath(GetImageUrl(strimagename)));
        if (img.Height &gt; 1000)
        {
            //strimagewidth = "535px";
            **width = 535;**
            ------------
        }
        else
        {
            //strimagewidth = img.Width.ToString() + "px";
            width = img.Width;
        }
        img.Dispose();
    }

    return Unit.Pixel(width);
}
</code></pre>

<p>I want to set image height not image width.but i didnt get height property inside the function.Can any body help</p>
