<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "content") %>
<%# DataBinder.Eval(Container.DataItem, "title") %>
<asp:ImageButton id="ImageButton1"  runat="server"></asp:ImageButton>
</ItemTemplate>
</asp:Repeater>
---------------------
读出N条记录 没条记录有个按纽 
想单击该按纽 删除记录 不知如何实现
以前都是 连接到另外一个文件del.aspx?id=id这样
现在想直接删除 不知?
(不习惯用datagrid)

解决方案 »

  1.   

    加入一
    <asp:ButtonColumn Text="删除" CommandName="Delete"></asp:ButtonColumn>
    在DeleteCommand事件中处理
      

  2.   

    指定ImageButton的CommandName,
    ibDelete.CommandName = "Recycled";在ItemCommand中if(e.CommandName == "Recycled")
    {
      delete.......
    }
      

  3.   

    Repeater没有Datakey属性
    那根据什么删除该记录呢?
      

  4.   

    UP
    不愿用DATAGRID的BUTTON列按楼上方法<asp:DataList id="DataList1" runat="server" DataKeyField="id" OnItemCommand="MyDataGrid_Delete">
    <ItemTemplate>
    <%# DataBinder.Eval(Container.DataItem, "time_data") %>
    <asp:Button id="Button1" runat="server" CommandName="Delete" Text="Button"></asp:Button>
    </ItemTemplate>
    </asp:DataList>
    -------------
    public void MyDataGrid_Delete(Object sender, DataListCommandEventArgs e)
    {

    if(e.CommandName=="Delete")
    {删除记录 
    } }
    但是没有反映
      

  5.   

    <asp:ButtonColumn Text="<img src='del.gif' board='0'>" ButtonType="LinkButton" CommandName="Delete"></asp:ButtonColumn>
      

  6.   

    回复人: LoveCherry(论成败,人生豪迈;大不了,重头再来!^_^) 精
      

  7.   

    要连接到另一个地址,就没必要用ImageButton控件了
      

  8.   

    datalist如何使用ButtonColumn列?