现页面上有一个dataGrid, 还有一个button, dataGrid的页脚中有一个TextBox控件,请问如何在button的点击事件中获取到dataGrid的页脚中的TextBox控件?

解决方案 »

  1.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=C4CE487D-02FB-450B-BF3C-9F870CBC66A5
      

  2.   

    我现在的问题是button是不包含在dataGrid中的,它是页面上的一个控件,有没有办法啊?
      

  3.   

    private void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
    {
    if(e.CommandName == "insert")
    {
    TextBox tb = e.Item.FindControl("tbFirstName") as TextBox;
    Response.Write(tb.Text);
    Response.End();
    }
    }