<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Images from database</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h1>Images from database</h1>
        <p>
        This site shows that the package will also process images when the image tags are generated on the fly based on an ASP.NET data source.
        </p>
        <p>
        This demo site uses an ObjectDataSource with a hard baked list of image urls. But you could easily retrieve the image urls from a real database.
        </p>

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="ObjectDataSource1" 
            EmptyDataText="There are no data records to display.">
            <Columns>
                <asp:BoundField DataField="Url" HeaderText="Url"  />
                <asp:TemplateField HeaderText="Image" >
                    <ItemTemplate>
                        <asp:Image ImageUrl='<%# Eval("Url") %>' runat="server"></asp:Image>
                    </ItemTemplate>
                </asp:TemplateField>
             </Columns>
        </asp:GridView>

         <asp:objectdatasource
              id="ObjectDataSource1"
              runat="server"
              selectmethod="GetAllImages"
              typename="ImageStore" />
    </div>
    </form>
</body>
</html>
