要求能取到Repeater中的几个值!最后前后台代码都有

解决方案 »

  1.   

    我直接用<a href=""> 现在就想知道怎么取到值
      

  2.   

    举个例子:  <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
                 <ItemTemplate>
                      <a href="javascript:void(0)" ><%#Eval("CompanyName") %></a>
                      <br />
                 </ItemTemplate>
            </asp:Repeater>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
                SelectCommand="SELECT [CompanyName] FROM [Customers]"></asp:SqlDataSource>
    jquery:
      $(document).ready(function() {
            $("a").bind("click", function() {
                    alert($(this).html());
                });
            });