GridView の使用
<asp:GridView runat="server" ID="myGrid"
OnRowCommand="MyGrid_RowCommand">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<img src='<%# Eval("SmallImageUrl") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<div>Title: <%# Eval("Title") %> </div>
<div>Weight: <%# Eval("Weight") %> </div>
<asp:Button runat="server" ID="GetOfferButton" CommandArgument='<%# Eval("OfferID") %>'></asp:Button>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
リストや製品のデータテーブルなどの製品のコレクションがあり、コレクションにこれらのフィールドがあると仮定します
class Product
{
//property Title
//property SmallImageUrl
//property Weight
}
あなたが持つことができます
myGrid.DataSource = <Replace with List of Products collection>;
myGrid.DataBind();