我在DetailList中的一个模版列里定义了一个TextBox,我希望在执行插入操作的时候能够得到其值,请问如何实现?多谢多谢!

解决方案 »

  1.   

    int gridCount = this.GridView1.Rows.Count;
    for (int i = 0; i < gridCount;i++ )
            {
                RadioButtonList rad = (RadioButtonList)GridView1.Rows[i].FindControl("ckb1");
                if (rad.SelectedValue == "ifuse")
                {
                    jbooknouse++;
                    booknouse = this.GridView1.Rows[i].Cells[0].Text;
                }            if (rad.SelectedValue == "ifps")
                {
                    booknops = this.GridView1.Rows[i].Cells[0].Text;                StringBuilder sbSql1 = new StringBuilder("");
                    sbSql1.Append("update ygtfpproj set ifps = 1,ifend = null, ifuse = null  where bookno = '" + booknops + "' and areaid='" + areaid + "'");
                    Db db1 = new Db();
                    db1.SqlsForInsUpd(sbSql1.ToString());
                }
            }
    这是gridview的看能不能帮上你.
      

  2.   

    ((TextBox)dgList.Items.FindControl("id")).Text------------------------
    http://fenglin.xland.cn
    ------------------------
      

  3.   

    string str = ((TextBox)DataList1.FindControl("TextBox1")).Text;