<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Rebex.Samples.Default"%>

<%@ Import Namespace="Rebex.Samples" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%-- page header --%>
    <h2>Sample ZIP files</h2>

    <%-- show list of sample ZIP files --%>
    <div>
        <asp:GridView ID="FilesGridView" runat="server" CssClass="list" BorderStyle="None" BorderWidth="0"
            BorderColor="whitesmoke" RowStyle-BorderColor="white" AlternatingRowStyle-BackColor="whitesmoke"
            AutoGenerateColumns="false">
            <HeaderStyle CssClass="listHeader" />
            <Columns>
                <asp:TemplateField HeaderText="Name" ItemStyle-CssClass="tdName" ItemStyle-Width="600">
                    <ItemTemplate>
                        <a href="<%# GetUrl(Container.DataItem as System.IO.FileInfo) %>">
                            <asp:Image ID="imgFile" runat="server" ImageUrl="<%# Util.GetIcon(IconType.File) %>" AlternateText="file" /><%# Eval("Name") %></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Size" HeaderStyle-CssClass="thNumber" ItemStyle-CssClass="tdNumber" ItemStyle-Width="100" ItemStyle-Wrap="false" >
                    <ItemTemplate>
                        <%# Util.GetSize((long)Eval("Length")) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Modified" DataField="LastWriteTime" DataFormatString="{0:G}" 
                    HeaderStyle-CssClass="thDate" ItemStyle-CssClass="tdDate" ItemStyle-Wrap="false" />
            </Columns>
            <EmptyDataTemplate>
                No files
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
</asp:Content>
