加上Cell试试.
TextBox tb = (TextBox)gvShopCart.Rows[0].Cell[你的列].FindControl("box1"); 
        Response.Write(tb.Text.ToString()); 

解决方案 »

  1.   

     加上Cell试试.
    TextBox tb = (TextBox)gvShopCart.Rows[0].Cell[你的列].FindControl("box1"); 
            Response.Write(tb.Text.ToString()); 
      

  2.   

    还是不行,取的还是源来textbox ,不是我新输入的资料.
      

  3.   

     if (!IsCallback) 
    改成
    if(!IsPostBack)
      

  4.   

     protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!IsCallback) ------------这里应该用IsPostBack,我没看过有人这里用IsCallBack的
            { 
      

  5.   

    楼主仔细点,看你开了好几个帖子了,很多人已经回答过IsPostBack 了,呵呵
      

  6.   

    不好意思,是我自己孤陋寡闻,不过假如你没有使用ajax或者说页面异步通信,就没必要用iscallback
    请参考http://www.cnblogs.com/lin614/archive/2007/10/30/942738.html
      

  7.   

    谢谢 高手 ,是我不小心打错了.
    if (!IsCallback) ------------这里应该用IsPostBack,我没看过有人这里用IsCallBack的 
            { 
      

  8.   

    //获取编辑框中内容string standard = ((TextBox)this.Gridpai.Rows[e.RowIndex].Cells[4].Controls[0]).Text;
      

  9.   

    !IsPostBack  第一次加载页面时用
      

  10.   

    string standard = ((TextBox)this.Gridpai.Rows[e.RowIndex].Cells[4].Controls[0]).Text;
    ----
    如果是采用gridview的默认编辑更新的方法是可以使用controls【0】,如果用了模板列还是使用findcontrol的好。