I want to get the text of TextBox of gridview on Button click.
I am using following code:
source code-
CellPadding="3"
style="font-size: small; font-family: Arial">
cs file code:
protected void btninsert_Click(object sender, EventArgs e)
{
for (int i = 0; i <= Gridview1.Rows.Count - 1; i++)
{
TextBox txt1 = (TextBox)Gridview1.Rows[i].Cells[2].FindControl("TextBox1");
string str=txt1.Text;
}
but in str I am getting only space "". plz help me
Thanks in advance

VulpesRank #55 · 29.2K reputationPosted Apr 13, 2012, 9:58 AM EDT
I'd try instead:
";
Label1.Text = str; // or however you want to display it
SenthilkumarRank #387 · 6.5K reputationPosted Apr 13, 2012, 5:14 PM EDT