我想在asp.net 2.0下实现DataList控件的编辑功能,但点击Edit没反应,不出现更新TextBox, 没有错误提示
    <form id="form1" runat="server">
    <div>
        <asp:DataList ID="dlEditItem" runat="server" DataKeyField="EmployeeID" OnCancelCommand="dlEditItem_CancelCommand" OnEditCommand="dlEditItem_EditCommand" OnUpdateCommand="dlEditItem_UpdateCommand">
        <HeaderTemplate>人员信息</HeaderTemplate>
        <ItemTemplate>
        <asp:Button ID="edit" runat="server" Text="Edit"/><%# Eval("LastName")%><%# Eval("FirstName")%>
        </ItemTemplate>
        <EditItemTemplate>
        <asp:Label ID="lastname" runat="server"><%# Eval("LastName")%></asp:Label>
        <asp:Label ID="firstname" runat="server"><%#Eval("FirstName") %></asp:Label>
        <asp:TextBox ID="title" runat="server" Text='<%#Eval("Title") %>'></asp:TextBox>
        <asp:Button ID="update" CommandName="update" runat="server" Text="Update"/>
        <asp:Button ID="cancel" runat="server" CommandArgument="cancel" Text="Cancel"/>
        </EditItemTemplate>
        <FooterTemplate><hr></FooterTemplate>
        </asp:DataList></div>
    </form>
后台:
public partial class DataListEditItem : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            DataListDataBind();
    }    private void DataListDataBind()
    {
        string connStr = ConfigurationManager.ConnectionStrings["northwind"].ConnectionString;
        SqlConnection conn = new SqlConnection(connStr);
        SqlDataAdapter Adapter = new SqlDataAdapter("select employeeid,lastname, firstname, title from employees", conn);
        conn.Open();
        DataSet ds = new DataSet();
        try
        {
            Adapter.Fill(ds, "testTable");
            dlEditItem.DataSource = ds.Tables["testTable"].DefaultView;
            dlEditItem.DataBind();
        }
        catch (Exception error)
        {
            Response.Write(error.ToString());
        }
        finally
        {
            conn.Close();
        }
    }
    protected void dlEditItem_CancelCommand(object source, DataListCommandEventArgs e)
    {
        dlEditItem.EditItemIndex = -1;
        DataListDataBind();
    }
    protected void dlEditItem_EditCommand(object source, DataListCommandEventArgs e)
    {
        dlEditItem.EditItemIndex = e.Item.ItemIndex;
        DataListDataBind();
    }
    protected void dlEditItem_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        int empID = (int)dlEditItem.DataKeys[e.Item.ItemIndex];
        TextBox newTitle = (TextBox)e.Item.FindControl("title");
        string strUpt = "update employees set title ='" + newTitle.Text + "' where employeeid=" + empID.ToString();
        string connStr = ConfigurationManager.ConnectionStrings["northwind"].ConnectionString;
        SqlConnection conn = new SqlConnection(connStr);
        SqlCommand cmd = new SqlCommand(strUpt, conn);
        conn.Open();
        try
        {
            cmd.ExecuteNonQuery();
            dlEditItem.EditItemIndex = -1;
            DataListDataBind();
        }
        catch(Exception error)
        {
            Response.Write(error.ToString());
        }
        finally
        {
            conn.Close();
        }
    }
}