textbox problem in GridviewRow
-
i m trying to access the textbox in gridviewrow. For Each row As GridViewRow In GridView1.Rows Dim textBoxText As String = _ CType(row.FindControl("TextBox1"), TextBox).Text Response.Write(textBoxText) Next Also tried to access through row = GridView1.Rows(e.RowIndex) Dim t As New TextBox t = CType(row.FindControl("TextBox3"), TextBox) msgbox t.text I face this error in both cases Object reference not set to instance of the object. use new key word to create an instance of object. Are there any prerequisites for this MGM
-
i m trying to access the textbox in gridviewrow. For Each row As GridViewRow In GridView1.Rows Dim textBoxText As String = _ CType(row.FindControl("TextBox1"), TextBox).Text Response.Write(textBoxText) Next Also tried to access through row = GridView1.Rows(e.RowIndex) Dim t As New TextBox t = CType(row.FindControl("TextBox3"), TextBox) msgbox t.text I face this error in both cases Object reference not set to instance of the object. use new key word to create an instance of object. Are there any prerequisites for this MGM
Is it template item? otherwise look Cell values of gridview row in debug mode.you can identify the problem. Thanks