从ListView中检索值

时间:2013-06-12 12:49:30

标签: c# asp.net sql

我需要从ListView中检索一些值,该值与SQL绑定到按价格排序ASC

要求:

  1. 列表中的总行数
  2. 最低价格和卖家名称,列表中的最低价格
  3. 最高价格和卖家名称,列表中有最高价格

    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
        <ItemTemplate>
           <tr>
              <td><asp:Label ID="SellersName" runat="server" Text='<%# Eval("SellerName") %>'/></td>
              <td><asp:Label ID="PriceLabel" runat="server" Text='<%# Bind("Price","₹ {0:N2}") %>'/>     </td>
           </tr>                               
        </ItemTemplate>                        
    </asp:ListView>
    
  4. 如何在C#中检索此信息?这可能是使用itembound或其他任何东西

1 个答案:

答案 0 :(得分:0)

这是浏览器上Listview的输出。          卖方名称价格     AB 1980.00     XX 2000.00     YY 2100.00     ZZ 2300.00