gdData绑定数据源时加上if(!IsPostBack)如下:
if(!IsPostBack)
{
gdData.DataSource = ??;
gdData.DataBind();
}

解决方案 »

  1.   

    楼上说的好像不行因为我是在另外的地方绑定数据源的,我调试了一下,在我点击保存按钮的时候,没有去重新绑定数据。而且我在textbox里绑定的数据是从数据库里读出来的,原来数据库里有值,可是我在保存的时候,获得的textbox里的值为空
      

  2.   

    http://blog.csdn.net/xianfajushi/archive/2008/11/30/3413317.aspx
      

  3.   

    假如你在gridview中添加一个模板列,并 在模板列中存放了一个dropdownlist控件。那么,问题就是:你如何去操作这个dropdownlist控件????//对于gridview控件: System.Web.UI.WebControls.GridViewRow rows = (GridViewRow)((Control)sender).Parent.Parent;//获取对于ui层次结构中服务器控件的父控件的父控件的引用
            DropDownList list = (DropDownList)rows.FindControl("DropDownList1");//对于datagrid控件: System.Web.UI.WebControls.DataGridItem item = (DataGridItem)((Control)sender).Parent.Parent;//获取对于ui层次结构中服务器控件的父控件的父控件的引用
            DropDownList list = (DropDownList)rows.FindControl("DropDownList1");其实运用的就是findcontrol方法。
    System.Web.UI.WebControls.GridViewRow rows = (GridViewRow)((Control)sender).Parent.Parent;//获取对于ui层次结构中服务器控件的父控件的父控件的引用之前博客里的文章,你可以看看。