static void

Image Thumbnail Example

Page Load

DirectoryInfo dir = new DirectoryInfo(Server.MapPath(@"~/Repository/Assets"));
List1.DataSource= dir.GetFiles("*.jpg");
List1.DataBind();

Markup

<asp:DataList runat="server" ID="List1" >
    <ItemTemplate>
        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Name","imgHandler.ashx?name={0}&size=1") %>' />
        <asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("Name","imgHandler.ashx?name={0}&size=2") %>' />
        <asp:Image ID="Image3" runat="server" ImageUrl='<%# Eval("Name","imgHandler.ashx?name={0}&size=3") %>' Width="200px" />
    </ItemTemplate>
</asp:DataList>