did you set the right command name in your aspx page? show the <asp:DataGrid ...>code

解决方案 »

  1.   

    <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="更新" CancelText="取消" EditText="编辑"></asp:EditCommandColumn>
      

  2.   

    <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="" CancelText="" EditText="编辑"></asp:EditCommandColumn>
    <asp:ButtonColumn Text="删除" CommandName="Delete"></asp:ButtonColumn>你这里面要指定相应的事件!
      

  3.   

    to:saucer(思归, MS .NET MVP) 谢谢!
    :(
    这种方法我已经调试通过了!但因为我是用代码后置的方法做的,
    我把.aspx.cs定义到了一个类中,

    [
    ParseChildren(true)
    ]override protected void InitializeSkin(Control Skin)
    {
    datagrid=(DataGrid)Skin.FindControl("datagrid");
    datagrid= AD.emailview("hnjt","user");
    datagrid.DataSource = Userlist;
    datagrid.DataBind();
    }        protected override void CreateChildControls() {
              InitializeSkin()         }