模板列中有BUTTON,请问如何得到这个事件呢?
private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
Mybutton bt1=new Mybutton();
//Button bt1= (Button)DataGrid1.FindControl("Button1");
bt1.Click +=new EventHandler(bt1_Click);
//bt1.ClickID=e.Item.Cells[2].Text.Trim();
bt1.ID=e.Item.Cells[1].Text.Trim();
}
public class Mybutton :System.Web.UI.WebControls.Button //前缀忘了,就是继承Button的意思
    {
public string ClickID;
} private void bt1_Click(object sender, EventArgs e)
{
            Mybutton bt1 = (Mybutton)sender;
            objXSqlClient.ExecuteCommand("Update [User] Set YuJing=1 Where  ID = "+bt1.ID,"");
    }
//以上的写法,指定的参数已超出有效值的范围。参数名: index //怎么样才能update 数据库中对应的ID呢?
//BUTTON在DATAGRID中,事件找到了,但找不到UPDATE对应的ID