<ItemTemplate>
<asp:ImageButton id="del_type" runat="server" CommandName="Select" ImageAlign="AbsMiddle" ImageUrl="../images/Ico_del.gif"
AlternateText="删除些项"></asp:ImageButton>
<asp:LinkButton id="LinkButton1" runat="server" CommandName="tt">LinkButton</asp:LinkButton>
<asp:Button id="Button1" runat="server" Text="Button" CommandName="ppp"></asp:Button>
</ItemTemplate>
这是我绑定的DataList中的项
其中LinkButton可以响应
但ImageButton和Button都没办法响应
我在网上搜了一大把都没有结果谢谢
快啊

解决方案 »

  1.   

    VB: If e.CommandName = "Select" then     end ifC#: If (e.CommandName = "Select" )
        {}
      

  2.   

    If (e.CommandName == "Select" )
      

  3.   

    既然LinkButton可以响应,理论上ImageButton和Button也是可以响应的,唯一不同的只是它们的ComanndName而已
      

  4.   

    不好意思,C#的写错了
    应该是
    If (e.CommandName == "Select" )
      

  5.   

    不管我怎么都不可以
    但是linkbutton可以
    后来我只有用个变像的办法
    把linkbutton里面的文字换成了一个图片
    也就和imagebutton效果一样了
    但是很是郁闷button和imagebutton都不行只有linkbutton可以
      

  6.   

    指定一下CommandName 就应该行了
      

  7.   

    正常来说 If (e.CommandName == "Select" )
    就可以了
      

  8.   

    也可能是事件丢了,检查一下InitializeComponent()方法里面的事件注册情况!