while updating in grid view
-
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Try Dim t As TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text Catch ex As Exception MsgBox(ex.Message) End Try End Sub i am getting error -- Object reference not set to an instance of an object.
-
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Try Dim t As TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text Catch ex As Exception MsgBox(ex.Message) End Try End Sub i am getting error -- Object reference not set to an instance of an object.
-
Dim t As New TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text
I Love T-SQL
No change with that code also dude...
-
No change with that code also dude...
-
yah thanks i got it Dim reqno As String = (CType(GridView1.Rows(e.RowIndex).Cells(1).Controls(0), TextBox).Text)
-
Dim t As New TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text
I Love T-SQL
-
very unhelpful answer. There is no need to create a new textbox and then assign the reference to an existing textbox.