how to get textbox value from a gridview control in a webpage programmed in asp.net 2.0 C#

Posted by Kumartyr under ASP.NET on 10/11/2013 | Points: 10 | Views : 21071 | Status : [Member] | Replies : 2
i am doing a forum
in the forum i have texbox in gridview control in forum page
how to get the textbox value in a string so as to check the same value with the DB
i have tried like below but no use

string Ques = (TextBox)GridViewFRM.Rows[i].Cells[0].FindControl("GVQuestionTextBox");




Responses

Posted by: Pradeepmanne on: 10/11/2013 [Member] Starter | Points: 25

Up
0
Down
hi,




foreach (GridViewRow grdRow in GridView1.Rows)
{
val= (TextBox)(GridView1.Rows[grdRow.RowIndex].Cells[0].FindControl("GVQuestionTextBox"));

}

Kumartyr, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/11/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer this link
http://forums.asp.net/t/1091612.aspx Same thing is applicable for TextBox control too

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Kumartyr, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response