B
Ben
Hi,
I need to use the value of a variable generated in the
'SelectedIndexChanged' event of a gridview in the 'RowUpdating' event.
I tried this below, but the variable generated in the 'SelectedIndexChanged'
event loses its value when starting the RowUpdating' event.
I think it has something to do with the postback and so refreshing the page
....
How can i do that?
Thanks
Ben
the code:
Friend myvar As String
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim row As GridViewRow = GridView1.SelectedRow
myvar = row.Cells(2).Text 'this is ok
end Sub
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
GridView1.RowUpdating
response.write(myvar) 'this gives nothing
I need to use the value of a variable generated in the
'SelectedIndexChanged' event of a gridview in the 'RowUpdating' event.
I tried this below, but the variable generated in the 'SelectedIndexChanged'
event loses its value when starting the RowUpdating' event.
I think it has something to do with the postback and so refreshing the page
....
How can i do that?
Thanks
Ben
the code:
Friend myvar As String
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim row As GridViewRow = GridView1.SelectedRow
myvar = row.Cells(2).Text 'this is ok
end Sub
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
GridView1.RowUpdating
response.write(myvar) 'this gives nothing