在datagrid中的自定义button列,以下步骤
1.在html中的<Columns></Columns>中加入
<asp:ButtonColumn ButtonType="PushButton" DataTextField="Name" HeaderText="MyName" CommandName="NameButton"></asp:ButtonColumn>
2.在datagrid中的ItemCommand中加入代码
private void DataGrid1_ItemCommand_1(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    if(e.CommandName == "NameButton")
    {
Response.Redirect("http://www.yahoo.com.cn");
     }
}
结果发现这个函数根本没被调用,请大家帮忙分析一下,多谢