J
John Mason
Hi,
I am new to asp.net (but not asp 3.0), and am trying to figure out why the
value of a global string variable is not available in a click event
sub-routine.
I declare the global variable directly under the script tag (before the
page_load sub)... as...
Dim globaltext as String
In an asp button click event I assign a value to the variable...(This sub
retrieves a selected value from a data grid)
Sub replaceClicked(sender as Object, e As DataGridCommandEventArgs)
Dim CarColumn as TableCell
CarColumn = e.Item.Cells(2)
globaltext = CarColumn.Text
lblReplace.text = "The globaltext value is " & globaltext & "..." ' This
works!
End Sub
But when I try to retrieve the value in another asp button click event, the
value does not come across...
Sub YesClicked(sender As Object, e As System.EventArgs)
lblReplace.Text = "The globaltext value is " & globaltext & "..." '
This is blank
End Sub
What am I doing wrong? Please help. Thanks in advance!
I am new to asp.net (but not asp 3.0), and am trying to figure out why the
value of a global string variable is not available in a click event
sub-routine.
I declare the global variable directly under the script tag (before the
page_load sub)... as...
Dim globaltext as String
In an asp button click event I assign a value to the variable...(This sub
retrieves a selected value from a data grid)
Sub replaceClicked(sender as Object, e As DataGridCommandEventArgs)
Dim CarColumn as TableCell
CarColumn = e.Item.Cells(2)
globaltext = CarColumn.Text
lblReplace.text = "The globaltext value is " & globaltext & "..." ' This
works!
End Sub
But when I try to retrieve the value in another asp button click event, the
value does not come across...
Sub YesClicked(sender As Object, e As System.EventArgs)
lblReplace.Text = "The globaltext value is " & globaltext & "..." '
This is blank
End Sub
What am I doing wrong? Please help. Thanks in advance!