<%@ Control Language="c#" Inherits="Microsoft.Samples.SqlServer.PopularItemsControl" CodeFile="_PopularItems.ascx.cs" %> <%@ OutputCache Duration="3600" VaryByParam="None" %> <!-- ===================================================================== File: _PopularItems.ascx for Adventure Works Cycles Storefront Sample Summary: User control which Displays the most commonly purchased items. This gets embedded in the home page. Date: June 16, 2003 ===================================================================== This file is part of the Microsoft SQL Server Code Samples. Copyright (C) Microsoft Corporation. All rights reserved. This source code is intended only as a supplement to Microsoft Development Tools and/or on-line documentation. See these other materials for detailed information regarding Microsoft code samples. THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. ======================================================= --> <%-- This user control displays a list of the most popular items this week. --%> <table width="95%" cellpadding="0" cellspacing="0" border="0"> <asp:Repeater ID="productList" runat="server"> <HeaderTemplate> <tr> <td class="MostPopularHead"> Our most popular items </td> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td bgcolor="#d3d3d3"> <asp:HyperLink cssclass="MostPopularItemText" NavigateUrl='<%# "ProductDetails.aspx?ProductID=" + DataBinder.Eval(Container.DataItem, "ProductID")%>' Text='<%#DataBinder.Eval(Container.DataItem, "Name")%>' runat="server" /> <br> </td> </tr> </ItemTemplate> <FooterTemplate> <tr> <td style="background-color:#d3d3d3"> </td> </tr> </FooterTemplate> </asp:Repeater> </table>