我在GridView放了一个TextBox
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
TextBox txt = (TextBox)(e.Row.FindControl("TextBox1"));
string aa = txt.Text;
Response.Write(aa); }怎么报错啊,请高手指点
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
TextBox txt = (TextBox)(e.Row.FindControl("TextBox1"));
string aa = txt.Text;
Response.Write(aa); }怎么报错啊,请高手指点
{
if(e.Row.RowIndex>-1)
{
TextBox txt = (TextBox)(e.Row.FindControl("TextBox1"));
string aa = txt.Text;
Response.Write(aa);
}
}